Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3.16k stars 894 forks source link

[Bug] Dropzone not working #5669

Open tomjrjones opened 1 month ago

tomjrjones commented 1 month ago

Bug report

What I did

Added dropzone as crud field

      CRUD::field([
        'label' => 'Image Gallery',
        'name' => 'image_gallery',
        'type' => 'dropzone',
        'withFiles' => array(
          'disk' => 's3',
          'path' => $storagePath
        ),
        'tab' => 'General'
      ]);

What I expected to happen

??

What happened

On the FE I get [object Object] error, and also this error

2

#2 upload (ajax) (21:06:34)
8.3.10
20.61ms
2MB
POST admin/product/dropzone/upload
No query results for model [App\Models\Product] 0
vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php#506
Illuminate\Database\Eloquent\ModelNotFoundException
503
504
505
506 
507
508
509
510
        }

        if (is_null($result)) {
            throw (new ModelNotFoundException)->setModel(
                get_class($this->model), $id
            );
        }

What I've already tried to fix it

use dropzone locally without s3 button, if the images are already uploaded, dropzone shows the previewed images.

Is it a bug in the latest version of Backpack?

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

Backpack, Laravel, PHP, DB version

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


8.3.10

### PHP EXTENSIONS:
Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, hash, FFI, fileinfo, filter, ftp, gd, gettext, gmp, json, iconv, intl, SPL, ldap, mbstring, session, standard, odbc, pcntl, exif, mysqlnd, PDO, pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, random, readline, Reflection, mysqli, shmop, SimpleXML, soap, sockets, sodium, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, Zend OPcache

### LARAVEL VERSION:
11.18.1.0

### BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.3.5
backpack/crud: 6.7.37
backpack/devtools: 3.1.5
backpack/generators: v4.0.5
backpack/pro: 2.2.17
backpack/theme-tabler: 1.2.11```
welcome[bot] commented 1 month ago

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use GitHub Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication channels:

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

-- Justin Case The Backpack Robot

karandatwani92 commented 1 month ago

Hey @tomjrjones

Do you mean it works on a local disk but not on s3?

tomjrjones commented 1 month ago

@karandatwani92 It works on neither, get the above error when uploading to local disk or s3