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

Nested Images are lost on update #35

Closed
alloyking opened this issue Jun 20, 2019 · 8 comments
Closed

Nested Images are lost on update #35

alloyking opened this issue Jun 20, 2019 · 8 comments
Labels
bug Something isn't working

Comments

@alloyking
Copy link

alloyking commented Jun 20, 2019

If I create a nested layout and the nested field contains an image everything will work on 'save'.
But once I update this record the images in the nested field are lost

Versions:
nova-flexible-content: 0.1.6
Nova : 2.0.3

On Save:
image

After Update:
image

@voidgraphics
Copy link
Member

Thanks for reporting this, we will take a look at it soon. We'd also accept a PR that fixes this is anyone is up to it.

@voidgraphics voidgraphics added the bug Something isn't working label Jul 3, 2019
@atnartur
Copy link

atnartur commented Jul 4, 2019

I was trying to fix the issue in plugin's code for 3 days but I couldn't do it.

Finally I created custom field for Nova with the following changes:

  • On the backend my custom field extends from Laravel\Nova\Fields\Image and binds the custom Vue component for fixing frontend's behaviour.
  • I created an file upload API for handling uploads directly from custom field's Vue part.
  • Custom field's Vue component extends from FileField from Nova and make direct API calls to server as described above.
  • At result Vue part write to FormData only filename of uploaded file. This filename is handling by nova-flexible-content as a simple text. This text simply saves to nova-flexible-content nested storage and everything goes very well.

I can share this code and also can create a pull request but I don't think this is the solution of the plugin bug. It adds the patch on the top of current architecture and don't fix the bug.

I think the problem from #29 also may be fixed with this approach.

@toonvandenbos
Copy link
Member

Latest tests with Nova v2.0.9 and dev-master (upcoming v0.1.8) are positive. Closed this issue since none of the cases seems to cause trouble anymore since 603e4a9.

@eboye
Copy link
Contributor

eboye commented Jun 9, 2021

Hi all,

I know this issue is resolved and yes it works when Flexible is used on model, but if used with Nova Settings it fails. This is the same issue I believe:

outl1ne/nova-settings#43

It just doesn't work when not in proper context?

@toonvandenbos
Copy link
Member

@zeyadaverotech why you don't learn to read? Why you don't try to ask politely? Why you don't try by yourself first?

I'm curious if you ever had a positive response on a message like this.

Oh, and... I saw what you wrote before you edited your message. We get email notifications, you know? You must be a very frustrated person and I hope you'll get well soon, but in the meantime you should probably try another job because you clearly don't belong here.

You're now blocked from all our repositories, congratulations! Bye.

@ameedasmah1
Copy link

is the problem still not working on Nova setting V4 !!
Does the photo still disappear?

@MartijnEngelkes
Copy link

MartijnEngelkes commented Jun 1, 2023

is the problem still not working on Nova setting V4 !! Does the photo still disappear?

I'm also still facing this issue. On create, images are saved, on update record image field is empty.
(laravel/nova": "~4.0" and "whitecube/nova-flexible-content": "^1.0")

@thisprojectworks
Copy link

thisprojectworks commented Apr 24, 2024

Same problem here. The problem is occurring when I use an Image Field inside A Flexible Field inside the Nova Settings package. If I use in a model, works well. If I save for first time everything works correctly and the images are saved on the disk and in the json field. But If I let empty the Image field with a previous image saved, the field image is removed from the json of the Flexible content, both key and value.

Laravel 11
whitecube/nova-flexible-conten 1.1
outl1ne/nova-settings 5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants