Skip to content

[Bug] Upload Field Inside Relationship Field Not Working Correctly #5717

Open
@misiekch

Description

@misiekch

Bug report

What I did

I am using relationship field to create contracts for my projects. Every contract has a multiple upload field:

CRUD::addFields([
    [
        'name' => 'name',
        'type' => 'text',
    ], [
        'name' => 'contracts',
        'type' => 'relationship',
        'subfields' => [
            [
                'name'  => 'name',
                'type'  => 'text',
            ], [
                'name'  => 'attachments',
                'type'  => 'upload_multiple',
                'withFiles' => [
                    'disk' => 'projects',
                ],
            ]
        ],
    ],
]);

I wanted to attach files to one of the added contracts:

Screenshot (1)

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.

Screenshot (2)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions