Laravel-Backpack / community-forum

A workspace to discuss improvement and feature ideas, before they're actually implemented.
28 stars 0 forks source link

Getting error using spatie/media-library in Backpack V6 #694

Closed haniramadhan-kkp closed 11 months ago

haniramadhan-kkp commented 1 year ago

I got this error message fopen(/tmp/phpSd49AI): Failed to open stream: No such file or directory.

In protected function setupCreateOperation() I add this

CRUD::field('tindaklanjut_files')
            ->label('Tindak Lanjut Files')
            ->type('upload_multiple')
            ->withMedia([
                'collection' => 'tindaklanjut_files', // will pick the collection definition from your model
            ]);

I found that is saved with duplicate file attached. Please give me some clue to solve this problem.

Update:

This problem only occur in create action. But in update action, the error doesn't appear. So, temporarily, I only add upload field in edit mode.

jcastroa87 commented 1 year ago

Hello @haniramadhan-kkp i check and is look like an error with spatie/media-library error 1 error 2

You can try to follow instructions here to check if solve your problem.

Cheers.

jcastroa87 commented 1 year ago

Hello @haniramadhan-kkp you was able to try solutions in the links I gave you?

Cheers.

haniramadhan-kkp commented 12 months ago

Hello @haniramadhan-kkp you was able to try solutions in the links I gave you?

Cheers.

Not yet, actually I can't find any clear step by step solution. Can you give me some clear solutions?

pxpm commented 12 months ago

Hello @haniramadhan-kkp, hope you are doing fine.

Help here to try to figure out what could be the issue.

Do you have any additional configuration in the model regarding that collection ? If you do, can you share it ?

Also, what's the db column type where you are storing those files ?

Are you casting, or have any mutator/accessor for that column in your model ?

Using our demo application, are you able to reproduce your issue ? We have an example in the ProductCrudController https://github.com/Laravel-Backpack/demo/blob/ad171c9bc3c5c076dc80d613fd6768c6ba6cedaf/app/Http/Controllers/Admin/ProductCrudController.php#L226 but it requires to run the demo locally.

Let me know, Cheers

jcastroa87 commented 11 months ago

Hello @haniramadhan-kkp

Please let us know if you still continue with the same problem or if it has already been resolved, if the same problem continues, send us the details and actions you have taken so that we can provide support, in case we do not receive news from you we will close the issue but you are free to open it again.

Thank you.

jcastroa87 commented 11 months ago

Hello @haniramadhan-kkp, we will close this case due to non-activity, if you need it you can reopen it or if it is a different topic, generate a new one.

Cheers