craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.27k stars 635 forks source link

[4.x]: "Showing your unsaved changes." keeps popping up after not making any changes #11106

Open Antimated opened 2 years ago

Antimated commented 2 years ago

What happened?

Description

I have a basic entry with just the default title field and a matrix field (that is limited to 1 item). Whenever I open an entry and just click anywhere on the page, the "Showing your unsaved changes." message pops up. If I discard the changes and click anywhere the same thing happens. If I save the entry and click anywhere, the same thing happens.

Steps to reproduce

  1. Open an entry
  2. Click somewhere
  3. Message pops up wether or not I changed content

Expected behavior

The message shouldn't pop up when I don't make any changes

Actual behavior

The message of unsaved changes constantly pops up after I click anywhere on the page

Craft CMS version

4.0.0.1

PHP version

8.1.5

Operating system and version

macOS Big Sur version 11.4 (Darwin 20.5.0)

Database type and version

MySQL 5.7.34

Image driver and version

GD 8.1.5

Installed plugins and versions

brandonkelly commented 2 years ago

It’s most likely due to a field type that is altering its post data after page load, making it look to Craft like something has changed about it. Can you tell me exactly which field types are in use on the page?

Antimated commented 2 years ago

It’s most likely due to a field type that is altering its post data after page load, making it look to Craft like something has changed about it. Can you tell me exactly which field types are in use on the page?

Yeah sure:

brandonkelly commented 2 years ago

Assuming “Image” is an Assets field?

Typed Link is the most likely culprit. Can you try duplicating the entry, and removing any blocks that use that field type, and see if it’s still reproducible?

Antimated commented 2 years ago

Assuming “Image” is an Assets field?

Typed Link is the most likely culprit. Can you try duplicating the entry, and removing any blocks that use that field type, and see if it’s still reproducible?

Yes "Image" is an assets field. Well the matrix (and the default title) is the only field that is displayed on this entry type right now, it's a project I've just started on :/

EDIT: duplicated the entry and removed the 1 row I had in my matrix, then saved the entry. Clicking anywhere still shows the message

brandonkelly commented 2 years ago

What fields are inside the Matrix field?

Antimated commented 2 years ago

What fields are inside the Matrix field?

This is the full matrix layout:

Full

Half

Note: doesn't matter which block type I use, happens on the both of them. Even if I clear out the matrix so it looks like this it has the same behavior:

Screenshot 2022-05-06 at 09 42 26

EDIT: here is a video of the issue in action

https://user-images.githubusercontent.com/2869409/167089358-d8357a69-2101-4942-91b6-856fcd2d87e4.mov

brandonkelly commented 2 years ago

Strange. Not able to reproduce locally.

Can you try disabling each of your plugins, and see if it still happens for you? If not, then re-enable them one-by-one to see which one is the culprit.

Antimated commented 2 years ago

Strange. Not able to reproduce locally.

Can you try disabling each of your plugins, and see if it still happens for you? If not, then re-enable them one-by-one to see which one is the culprit.

I just disabled Typed link field as a test and instantly stopped this behaviour. I should probably notify them as I have a few errors using that plugin now :( (integrity violations etc)

brandonkelly commented 2 years ago

Hm… if you don’t have any Typed Link fields on the page, I’d be a bit surprised if that was the actual culprit. Maybe try re-enabling that, but disabling all non-field type plugins that could be interacting with the page:

Antimated commented 2 years ago

It's weird because I disabled and enabled typed link field (that field type is actually present within my matrix as I said before) but now the unsaved changes behaviour is gone...

EDIT: Now I randomly have it again

maxstrebel commented 2 years ago

It guess it's a bug with typed link field. We just removed it from our sites, because it causes a myriad of problems on Craft 4.