-
Notifications
You must be signed in to change notification settings - Fork 638
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
[3.x]: Unpredictable Javascript error when entry auto-saves causes regular save to fail #12445
Comments
Thanks for reporting that! We just released Craft 3.7.62 and 4.3.5 with updates to that logic to be a bit more defensive. Now if If you don’t mind, it would be great if you could attempt to reproduce on 3.7.62 with your browser console open, and let me know what the warning message is, so we can fix the bug at the source. |
Testing on the 3.7.62 release I was not able to reproduce the endless spinner and subsequent error log, as the added throw/catch fixes this, instead I got the new console warnings: I did notice that when the "Unexpected input name" warning appears, ANY content changes done, including the one that triggered that warning, will be lost when the document is saved. This wasn't an issue earlier, as saving would not work anymore when the error had occured, but now an editor would assume everything is OK, even when it's not. A little breakdown of what steps I did the for the screenshot above:
Updated entry content before saving Loaded entry content after save (only the first of the content changes was saved) Screenshot of all network requests, payload and response preview Request #1 Request #2 Request #3 Request #4 |
We were able to track down the underlying culprit, and just released Craft 3.7.63.1 and 4.3.6.1 with a fix 🎉 |
Thanks for fixing this! 🥳 I can confirm that I'm not able to trigger this error and loose content anymore. |
What happened?
Description
Sometimes when editing fields inside a matrix, auto-save triggers a warning that in turn makes saving impossible.
The triggered error is the following:
This error is triggered because
nestedNames
inside_filterFieldInputName()
(https://github.com/craftcms/cms/blob/3.8/src/web/assets/cp/src/js/DraftEditor.js#L1289) returns null (I haven't been able to determine why this returns null).The first time the error is triggered, it is caught by https://github.com/craftcms/cms/blob/3.8/src/web/assets/cp/src/js/DraftEditor.js#L890 and logged as a warning to the console, and the auto-save icon turns into an endless spinner.
When the first warning has occured, an error will be triggerd if the user then tries to save the entry.
Steps to reproduce
I've not been able to reproduce this error in a consistant manner, but it has been triggered sometimes following these steps.
Expected behavior
Update of content should work as expected.
Actual behavior
Javascript error is triggered causing auto-save and save to fail.
Craft CMS version
3.7.61
PHP version
7.4.3
Operating system and version
Linux 5.10.102.1-microsoft-standard-WSL2
Database type and version
MySQL 8.0.29
Image driver and version
GD 7.4.30
Installed plugins and versions
The text was updated successfully, but these errors were encountered: