- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Closed 🐛 When a textformat has no text-editor configured ckeditor crashes Closed: duplicate as a duplicate of this. Crediting @tim@lammar.be for that!
Clearly, a tiny percentage of people want to configure CKEditor 5 in a way that there's no toolbar at all. @tim@lammar.be, can you please explain what your use case is for:
When you have a text format where you don't want a toolbar and you configure the text-editor field to be none, […]
?
Thanks! 🙏
- 🇧🇪Belgium Tim Lammar
@Wim Leers,
Sure :-)
Our use case is we have a text format field and 2 form modes for content editing of that specific node type.
In one form mode, the field may be filled with content generated by editor buttons. In the other form mode, the same field may only be filled with text (much like a textarea field). This is mostly because the one form mode is used for users with more permissions, like using advanced editor functionality. The other form mode is used for users with less permissions and actually can not use the editor. So the field needs to be text format, but for some users the editor may not be used. So we had a text format that had no editor active (what was possible in CKEditor 4, but now with the upgrade to Drupal 10, it gave issues) - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Thanks for the fast clarification!
So the field needs to be text format, but for some users the editor may not be used. So we had a text format that had no editor active (what was possible in CKEditor 4, but now with the upgrade to Drupal 10, it gave issues)
Even with no buttons, you'll still be able to create
<p>
and<br>
in CKEditor 4/5 — without those tags, it cannot function.What you're describing indeed sounds like a use case for having NO text editor for that one text format. What problem did you run into when you tried doing that? 🤔
- 🇧🇪Belgium Tim Lammar
I don't remember exactly what errors occurred, but it had to do with the fact that in the code there are array methods used on toolbar items. These are in this case non existing and so causing php errors (something like expecting array, got NULL).
The patch I provided in the previous ticket fixed the ones I encountered, but it's possible other places need to be fixed as well (ref: https://www.drupal.org/project/drupal/issues/3372452#comment-15136932 🐛 When a textformat has no text-editor configured ckeditor crashes Closed: duplicate ) - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
I don't see how any toolbar item method would be getting invoked when no text editor is configured? 🤔
- 🇮🇳India prashant.c Dharamshala
I added MR for the
11.x
, change the condition to check whether the JSON is valid or not. Changes need to be reviewed.