Open misiekch opened 1 week ago
Thank you for reporting this issue. It appears you're experiencing a bug with the upload_multiple field inside a relationship field in Backpack CRUD. This is a known issue that has been reported and addressed in recent versions of Backpack.
Based on the information provided in the Github Issue #5392, this bug was fixed in Backpack CRUD version 6.4.2. However, you're using version 6.7.41, which is more recent, so the bug should have been resolved.
Here are a few things you can try:
Make sure you're using the latest Uploaders feature. According to the fix for uploaders in repeatable relationships, the way uploads are handled in relationships has been improved.
Check if you're using the correct syntax for the withFiles
option. The correct syntax should be:
'withFiles' => [
'disk' => 'projects',
'path' => 'your_path_here',
],
Make sure to specify a path
if you want the files to be stored in a specific directory on your disk.
If you're still experiencing issues, it might be worth checking if there are any conflicts with your specific implementation or if there's a new bug that hasn't been reported yet.
If the problem persists after trying these steps, I recommend opening a new issue on the Backpack CRUD GitHub repository with a detailed description of your setup and the steps to reproduce the bug.
Remember to always back up your data before making changes to your application or updating packages.
Relevant sources:
Github Issue (closed): [Bug] "upload_multiple" field within subfields of a "relationship" field does not allow files to be deleted Github Issue (closed): [Bug] The file field that was used within the relationship's subfields, was not sent with the request Github Issue (closed): Multiple Upload doesn't work in a relationship with subfields Github Issue (closed): [Bug] upload and upload_multiple fields don't work as subfields inside relationship Github Issue (closed): [Bug] Uploaded files cannot be deleted Github Issue (closed): Upload in a relationship with subfield Github Issue (open): [Bug] Upload subfield contains wrong url in repeteable relationship field Github Issue (closed): [Bug] Multiple upload in a relationship does not work with Spatie/MediaLibrary Handle uploads inside relationships
Hey @misiekch
Thanks for reporting the BUG. We have a PR ready that fixes uploader-related issues, but the fix leads to breaking changes.
Thus, We'll be launching Backpack v7, hopefully at the end of this month or next, which will cover uploader fixes and many other features/fixes that require breaking changes.
Bug report
What I did
I am using relationship field to create contracts for my projects. Every contract has a multiple upload field:
I wanted to attach files to one of the added contracts:
What I expected to happen
Uploaded files should be attached to one contract only.
What happened
When I saved the form, the uploaded files were attached to all of the contracts.
What I've already tried to fix it
Last working backpack/crud version is 6.4.1
Is it a bug in the latest version of Backpack?
After I run
composer update backpack/crud
the bug... is it still there?Yes, since backpack/crud:6.4.2
Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:PHP VERSION:
8.2.22
LARAVEL VERSION:
10.48.22.0
BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.3.6 backpack/crud: 6.7.41 backpack/generators: v4.0.7 backpack/pro: 2.2.22 backpack/theme-tabler: 1.2.15