Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Subfield upload type duplica disk path #5699

Closed
cod3rshotout opened this issue Oct 18, 2024 · 0 comments
Closed

[Bug] Subfield upload type duplica disk path #5699

cod3rshotout opened this issue Oct 18, 2024 · 0 comments
Labels

Comments

@cod3rshotout
Copy link

cod3rshotout commented Oct 18, 2024

Bug report

What I did

I have defined a field for slide upload:

    CRUD::field([
            'name'      => 'images',
            'label'     =>  __('backend/slider.slides'),
            'type'      => 'repeatable',
            'subfields' => [
                [
                    'name'    => 'alt_text',
                    'wrapper' => ['class' => 'form-group col-md-6'],
                    'label' => __('backend/slider.alt_text'),
                ],
                [
                    'name'    => 'image',
                    'type'    => 'upload',
                    'label' => __('backend/slider.image'),
                    'wrapper' => ['class' => 'form-group col-md-6'],
                    'withFiles' => [
                        'disk' => 'uploads',
                        'path' => 'slides',
                    ]
                ],
            ],
        ]);

This is my filesystem implementation:

'uploads' => [
    'driver' => 'local',
    'root'   => public_path('uploads'),
    'url'    => env('APP_URL') . '/uploads',
    'visibility' => 'public',
],

What I expected to happen

The image is correctly uploaded in the folder.

What happened

But the link that appears on the repeater for some reason duplica the path "slides", weird thing is that the file name is correct. So if click on the file name I have this url: "/uploads/slides/slides/obtq-rWtX.jpg"

What I've already tried to fix it

If I use withFiles => true the issue doesn't appear, but I want upload the slides under: public/slides folder.

Is it a bug in the latest version of Backpack?

After I run composer update backpack/crud the bug... is it still there? Yes.

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

PHP VERSION:

8.2.4

PHP EXTENSIONS:

Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, session, PDO, pdo_sqlite, standard, posix, random, readline, Reflection, Phar, SimpleXML, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, bcmath, exif, gd, gmp, imagick, intl, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, soap, sodium, zip

LARAVEL VERSION:

11.28.1.0

BACKPACK PACKAGE VERSIONS:

backpack/basset: 1.3.6
backpack/crud: 6.7.41
backpack/filemanager: 3.0.8
backpack/generators: v4.0.7
backpack/logmanager: v5.0.2
backpack/medialibrary-uploaders: 1.2.1
backpack/newscrud: 5.1.0
backpack/pagemanager: 3.3.2
backpack/permissionmanager: 7.2.1
backpack/pro: 2.2.21
backpack/revise-operation: 2.0.0
backpack/settings: 3.1.1
backpack/theme-tabler: 1.2.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

1 participant