verbb / navigation

A Craft CMS plugin to create navigation menus for your site.
Other
90 stars 22 forks source link

Changes to asset fields aren't saved #366

Closed d-karstens closed 12 months ago

d-karstens commented 1 year ago

Describe the bug

Hi,

After updating to Craft 4.5 we've encountered an issue where changes to asset fields are not saved in a node - other fields seem to update normally

I've recorded a short video demonstrating the issue on a fresh install with no other plugins

https://github.com/verbb/navigation/assets/21274925/4504e3b5-6dbf-404a-b029-5a718676f122

Steps to reproduce

  1. Add an asset field to a node
  2. Upload an image to the field and save the node
  3. Asset field changes are not saved

Craft CMS version

4.5.0

Plugin version

2.0.20

Multi-site?

No

Additional context

No response

engram-design commented 1 year ago

Can't seem to replicate that on 4.4.x or 4.5.x at the moment. See the attached video. https://share.cleanshot.com/j0Tby398

Out of interest, can you inspect the network request to see if there's data for the asset field in the payload?

https://share.cleanshot.com/V7hHlXmq

d-karstens commented 1 year ago

I saw there were two network requests - the first with the data when the element is uploaded lfvndtwlgn[fields][test][]: 517

Screenshot 2023-08-25 at 1 55 45 pm

and the second when I save the node where the data is missing Screenshot 2023-08-25 at 1 55 53 pm

Not sure if that's the normal behavior though

engram-design commented 1 year ago

Alright, I can now replicate that.

The second save-draft request is marked as cancelled. The first call will be as soon as the field is changed. That triggers the draft to be autosaved. The second is when you click the "Save" button, which is being marked as cancelled for me.

image

However, I see this exact behaviour in Craft 4.4.x, which is working, but not in Craft 4.5.x The payloads are identical. Looking into it.

andrewhawkes commented 1 year ago

Just ran into this myself, using plugin version 2.0.20 on Craft CMS 4.5.2. Note, that I'm not getting any console errors but I can see the xhr getting cancelled on the same action URL as above.

engram-design commented 1 year ago

Should be fixed for the next release. To get this early, run composer require verbb/navigation:"dev-craft-4 as 2.0.20".

engram-design commented 12 months ago

Fixed in 2.0.21