We started to have some issue with creating and editing Entries when passing to Craft CMS 3.2. We figured out the real issue was that the Cp panel JS function (window.draftEditor = new Craft.DraftEditor()) located in craftcms/cms/src/templates/_layouts/element.html:277 end up having a empty value instead of the Settings object set the line before in Twig. We started debugging why this "settings" object was returning nothing and we end up finding that its because the variables previewTargets was causing an issue.
The previewTargets variable is set in craftcms/cms/src/templates/_layouts/element.html:35 which end up calling the PHP functiongetPreviewTargets() craftcms/cms/src/base/Element.php:1429.
The issue is at the line craftcms/cms/src/base/Element.php:1436 with the function strtolower(static::displayName()), that function in a french system will convert {type} to Entr茅e(Entry) and that 茅 end up having some UTF-8 issue in twig which end up crashing the settings variables which go to nothing in JS. Maybe it's because of the new setup with the plugins Stringy which handle utf8, I think that you started to use since 3.2 ?
Because of that error, all AJAX don't work because the javascript don't have the data necessary to call the server since window.draftEditor = new Craft.DraftEditor() is empty. We test with an English site and the window.draftEditor = new Craft.DraftEditor() was having the data and was working.
For now, since we use a SPA frontend with Vue.js , we just remove the URI inside all our entries so that the if check in craftcms/cms/src/base/Element.php:1433 don't execute.
Thanks for the detailed report! If you change strtolower to mb_strtolower does that fix the problem for you?
And if that doesn鈥檛 work, what about StringHelper::toLowerCase ?
'type' => StringHelper::toLowerCase(static::displayName())
StringHelper::toLowerCase(static::displayName()) works !!
Great, thanks for testing! We just released Craft 3.3.3 with that fix.
Most helpful comment
Great, thanks for testing! We just released Craft 3.3.3 with that fix.