You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing the same old issue than #465 that was resolved years ago in #472. In summary when adding a new InlineModelAdmin item inside a plugin, the CKEditor fail to be initialized and the field is just a raw textarea.
Environment
Python: 3.10
Django: 5.0.7
DjangoCMS: 3.11.6
djangocms-text-ckeditor: 5.1.5
To Reproduce
Create a plugin with models Foo and FooItem where FooItem is related to Foo with a foreign keys, contain a field for a CKEditor content (with widget TextEditorWidget) and managed with InlineModelAdmin;
Add an object of this plugin in a page;
Open plugin edition;
Add a new item into plugin;
The CKeditor content field in newly added FooItem object is still a textarea;
Here is a simple video for demonstration:
record.webm
This results to this error in browser console:
With debugger just before error (using a debug breakpoint):
And in inspector for the newly added object:
We can see the JavaScript code attempts to use a id attribute but the payload from object is just an Array.
Expected behavior
Newly added inline admin items should have CKEditor properly initialized.
From what i have searched, it seems the commits from #472 was working well, it did not expected an id attribute to resolve field name:
I tried to patch my local bundle for the id attribute against Array, it worked but then it broke because of further code that attempt to reach other attributes like toolbar.
The text was updated successfully, but these errors were encountered:
This won't make it because djangocms-text-ckeditor has
a bug with inline forms, newly added item does not properly
initialize the CKEditor Javascript
django-cms/djangocms-text-ckeditor#680
So finally we need to make slide item through children plugin
of SliderPlugin.
Summary
I'm facing the same old issue than #465 that was resolved years ago in #472. In summary when adding a new InlineModelAdmin item inside a plugin, the CKEditor fail to be initialized and the field is just a raw textarea.
Environment
To Reproduce
Foo
andFooItem
whereFooItem
is related toFoo
with a foreign keys, contain a field for a CKEditor content (with widgetTextEditorWidget
) and managed withInlineModelAdmin
;FooItem
object is still a textarea;Here is a simple video for demonstration:
record.webm
This results to this error in browser console:
With debugger just before error (using a debug breakpoint):
And in inspector for the newly added object:
We can see the JavaScript code attempts to use a
id
attribute but the payload from object is just an Array.Expected behavior
Newly added inline admin items should have CKEditor properly initialized.
From what i have searched, it seems the commits from #472 was working well, it did not expected an
id
attribute to resolve field name:https://github.com/vxsx/djangocms-text-ckeditor/blob/2364627726dfb1682aeefa1f7ab2d4972155e9f1/djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/cms.ckeditor.js#L217
Opposed to master branch code that is expecting the attribute:
https://github.com/django-cms/djangocms-text-ckeditor/blob/master/djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/cms.ckeditor.js#L431
I tried to patch my local bundle for the
id
attribute against Array, it worked but then it broke because of further code that attempt to reach other attributes liketoolbar
.The text was updated successfully, but these errors were encountered: