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

[4.x]: If you edit a field and quickly save, the old content will be applied #11789

Closed
maxstrebel opened this issue Aug 16, 2022 · 8 comments
Closed

Comments

@maxstrebel
Copy link

maxstrebel commented Aug 16, 2022

What happened?

Description

If you have an entry and remove a Matrix block and save really quick (in this case with shortcut), the Block will persist (because the draft was not yet merged?).

I'm reporting this, because I try to find a reason why my client experiences severe problems while saving his (reasonably complex) pagebuilder. I think there's something wrong with the drafts system. And this is on a MBP and a very fast docker.

Steps to reproduce

  1. Create a Matrix Block
  2. Create an entry and add a Matrix Block
  3. Save
  4. Delete the Matrix Block and save as fast as possible
  5. Matrix Block os not deleted

Expected behavior

Craft applies the state the current fields are in

Actual behavior

Craft applies old state.

Video of behavior

The first time I do not succeed, second time the bug is visible.

matrix-reloaded.mov

Craft CMS version

4.2.1.1

PHP version

8.0

Operating system and version

MacOS Monterey 12.5

Database type and version

MySQL (mariadb 10.5.13)

Image driver and version

Imagick 3.7.0 (ImageMagick 7.1.0-35)

Installed plugins and versions

  • NEO (but not active in this section)
  • Redactor
@maxstrebel maxstrebel changed the title [4.x]: If you remove a Matrix block and quickly save, the block will still be there [4.x]: If you edit a field and quickly save, the block will still be there Aug 16, 2022
@maxstrebel
Copy link
Author

maxstrebel commented Aug 16, 2022

EDIT: same also works with a field. IF you alter the content and very quickly save, the old content will be applied.

text-resurrection.mov

@maxstrebel maxstrebel changed the title [4.x]: If you edit a field and quickly save, the block will still be there [4.x]: If you edit a field and quickly save, the old content will be applied Aug 16, 2022
@brandonkelly
Copy link
Member

Thanks for reporting that. This was happening if the form was submitted before the Matrix block had finished animating away, so its inputs were still in the DOM (and the form’s POST data). Fixed for the next Craft 3 and 4 release.

The same bug was occurring for relations that were removed as well, so that’s also fixed.

@maxstrebel
Copy link
Author

maxstrebel commented Aug 18, 2022

Thanks Brandon for the fix. Did you see that this also can be done to text/redactor fields (my second video)?

@brandonkelly
Copy link
Member

Doh, missed that. However that is going to be a Redactor bug. It must have some short delay before it writes out WYSIWYG changes to its input.

@brandonkelly
Copy link
Member

Craft 3.7.52 and 4.2.2 are out now with those fixes.

@maxstrebel
Copy link
Author

Thank you Brandon. Will you add a ticket to redactor, or shall I do that?

@brandonkelly
Copy link
Member

I meant Redactor.js. You can add an issue but it’s likely not something we have control over.

@maxstrebel
Copy link
Author

Understood. Thank you.

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

No branches or pull requests

2 participants