spicywebau / craft-neo

A Matrix-like field type for Craft CMS that uses existing fields
Other
403 stars 63 forks source link

Craft keeps showing "Unsaved Changes" upon saving of an entry with Neo fields #875

Closed mscherr-fastspot closed 3 months ago

mscherr-fastspot commented 3 months ago

Bug Description

Upon save, Craft will show a "Showing your unsaved changes." without additional edits being made. If I remove all Neo fields (or specific ones, see below), the issue goes away.

The issue seems to happen only on specific types of Neo blocks. I initially thought it was blocks that had child blocks associated with them, but that is not the case. It only happens on specific blocks though.

For example, it happens for this one (Visual Call to Action - no child blocks):

https://share.cleanshot.com/LvXcbgcT

But not something like this (Testimonial - no child blocks):

https://share.cleanshot.com/sdHLYL7Q

If you need me to provide any more information like the field layouts please let me know.

Might be related to: https://github.com/craftcms/cms/issues/11106

Steps to reproduce

  1. Add a specific kind of Neo block to an entry (see bug description above, cannot determine root cause)
  2. Save the entry (CMD + S)
  3. Observe Craft saying there are unsaved changes immediately after save

Expected behaviour

I expect upon entry save that Craft does not prompt to tell me there are unsaved changes.

Neo version

4.1.0

Craft CMS version

4.8.6

What is the affected Neo field's propagation method?

Save blocks to all sites the owner element is saved in

Does this issue involve templating, and if so, is eager-loading used?

This is not a templating issue

ttempleton commented 3 months ago

This is likely a bug with Hyper, as I'm able to reproduce this with a Hyper field on an entry and on a Matrix block, and I'm unable to reproduce the same behaviour with Typed Link Field in any context.