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

Control panel saying "Showing your unsaved changes" on opening entry #287

Closed
bleepsandblops opened this issue Mar 8, 2024 · 13 comments
Closed

Comments

@bleepsandblops
Copy link

Describe the bug

If I have a Vizy field with one block (or more) in it, the CP shows the message "Showing your unsaved changes" on opening the entry, before doing anything in it, not even focusing in the Vizy field. It shows the Vizy field with the blue border indicating that that's the field that has changed.

Cf screenshot below, I've even tried with a field that's just an UI element so literally nothing to change in it.
Screenshot 2024-03-08 at 10 11 47

Steps to reproduce

  1. Create new entry with vizy field
  2. Add a block in the field
  3. Save the entry
  4. Reopen the entry, the message appears instantly

Craft CMS version

4.8.1

Plugin version

2.1.16

Multi-site?

No

Additional context

This doesn't happen if the field is left completely empty.

@bleepsandblops
Copy link
Author

Looks related to #282 but there are no nested Vizy fields here

@engram-design
Copy link
Member

I can't replicate this with your exact setup I'm afraid. Does saving the entry and re-loading change the behaviour at all?

@bleepsandblops
Copy link
Author

No it doesn't...

Did some more testing, I have another Vizy field with lots of blocks too, and this one doesn't exhibit that behaviour unless I add a block with a sub Vizy field (so clear case of #282).

But for the one in my screenshot, I can't really make sense of it as not even the available blocks have sub Vizy fields.

@bleepsandblops
Copy link
Author

Did some more digging, if I open the entry, I immediately get that message, then if I look in the network tab I can see a call to the admin/actions/elements/save-draft action with those two lines in the payload:
fields[contentPage][vizyData]: [{"type":"vizyBlock","attrs":{"id":"vizy-block-ZymZBfJ4v0","enabled":false,"collapsed":true,"values":{"type":"type-vZc30jrmgy","content":{}}}},{"type":"vizyBlock","attrs":{"id":"vizy-block-VLavpzygWv","enabled":false,"collapsed":true,"values":{"type":"type-elc8vQ9oNw","content":{}}}}]
modifiedDeltaNames[]: fields[contentPage]
If I save and open again, exact same content for those two lines. And if I open the content table I can also see for that field the exact same json...

So I don't understand what it thinks has changed? Anything else I can look at?

@engram-design
Copy link
Member

Fixed for the next release. To get this early, run composer require verbb/vizy:"dev-craft-4 as 2.1.18".

@engram-design
Copy link
Member

Fixed in 2.1.19

@johndwells
Copy link

I'm still encountering this, after upgrading to 2.1.19, running Craft 4.10.4.

Our Vizy fields are very simple, just using the Default config and there are no custom blocks. We have one standalone Vizy field, and one inside a Matrix block, and both appear to cause the CP to detect unsaved changes. This is the case even if the contents of the field are empty.

Screenshot 2024-07-03 at 11 56 23 AM

Please let me know if there's any info I can provide. This is our first time using Vizy so we don't have any other site to compare it to.

@engram-design
Copy link
Member

Strange, Vizy should now not even start checking if content is different until you interact with the field (by clicking on it). I've continued to make improvements on this front though, and should be fixed for the next release. To get this early, run composer require verbb/vizy:"dev-craft-4 as 2.1.19".

@johndwells
Copy link

Thanks Josh, we'll give it a go and feedback the results.

@johndwells
Copy link

Hey Josh, just wanted to confirm that we no longer get the "Showing your unsaved changes" by merely visiting the entry in the CP. Thanks so much!

@engram-design
Copy link
Member

Should have mentioned this should be fixed in 2.1.20 as well.

@bleepsandblops
Copy link
Author

@engram-design i'm still experiencing this on an entry type with two Vizy fields I'm afraid... doesn't do it if there is just one Vizy field.
It was doing it on Craft 4 and I've upgraded the site to Craft 5 and the bug is still there.
Craft Pro 5.2.8
Vizy 3.0.1

@bleepsandblops
Copy link
Author

Update! The issue is not due to multiple Vizy fields but to a Hyper field + a Vizy field - Have created issue verbb/hyper#179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants