I'm using Backdrop v1.30.0 with CKEditor 5 Version: 44.1.0. All has been swell so far. Suddenly, changes I have made in the editor are not preserved after saving (other changes to other fields are saved). Additionally, nothing happens now if I hit the 'source' button. Earlier today, the word 'source' for the toolbar button was inexplicably replaced with 'expand.' When I clicked it, it changed to 'collapse,' but did not do anything and still did not switch to viewing the source. What might be causing CKEditor to misbehave? What can be done to fix it?

Comments

This may be a Javascript error (the fact that the source button doesn't work may be an indication of this). Can you check the browser's console after opening the edit form and after clicking Source, to see if there are any errors there?

Thanks. I don't spend much time in the console. Yes, there is an error message.

Upon loading the edit page:

js_haOE-8z_9l1RB9MIOEXtzZzmkzmhlCWLVrLD75ALoJ0.js:1827 The CKEditor instance could not be initialized.
(anonymous) @ js_haOE-8z_9l1RB9MIOEXtzZzmkzmhlCWLVrLD75ALoJ0.js:1827

js_haOE-8z_9l1RB9MIOEXtzZzmkzmhlCWLVrLD75ALoJ0.js:1828 CKEditorError: Cannot read properties of undefined (reading 'toString')
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#erro... read properties of undefined (reading 'toString')
   at _getResizedWidthHeight (js_haOE-8z_9l1RB9MIOEXtzZzmkzmhlCWLVrLD75ALoJ0.js:461:24)
   at Ut.converter (js_haOE-8z_9l1RB9MIOEXtzZzmkzmhlCWLVrLD75ALoJ0.js:650:37)
   at Ut.fire (ckeditor5-dll.js?v=1.30.0:5:726731)
   at Ut._testAndFire (ckeditor5-dll.js?v=1.30.0:5:311810)
   at Ut._testAndFireAddAttributes (ckeditor5-dll.js?v=1.30.0:5:312023)
   at Object.convertAttributes (ckeditor5-dll.js?v=1.30.0:5:312329)
   at Ut.<anonymous> (ckeditor5-dll.js?v=1.30.0:5:342505)
   at Ut.fire (ckeditor5-dll.js?v=1.30.0:5:726731)
   at Ut._testAndFire (ckeditor5-dll.js?v=1.30.0:5:311810)
   at Ut._convertInsert (ckeditor5-dll.js?v=1.30.0:5:309903)
(anonymous) @ js_haOE-8z_9l1RB9MIOEXtzZzmkzmhlCWLVrLD75ALoJ0.js:1828

And upon clicking the source button, there are more error messages.

I used the new Chrome AI console 'understand this error' helper which provided the text in this document. It did give me a hint it might be something to do with an image. I am dealing with content that is being imported from a Drupal7 site and the issue does not affect other content.

It was the image. I deleted it and the problem went away. Whew.