Skip to content

Commit 2d67f66

Browse files
committed
fix: Adding text-enabled plugins failed after second
1 parent 6df8ae3 commit 2d67f66

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ from djangocms-text-ckeditor, and clean up old tables. All you have to do is:
6666
* add ``djangocms_text`` to ``INSTALLED_APPS`` (see above)
6767
* run ``python -m manage migrate djangocms_text``
6868

69-
**Attention**: The migration command also deletes djangocms-text-ckeditor's
69+
**Attention**: The migration command also deletes djangocms-text-ckeditor's
7070
tables from the database (to avoid referential integrity issues). To be on
7171
the safe side, make a backup of its content.
7272

private/js/cms.editor.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ class CMSEditor {
521521
cms_history: 0,
522522
};
523523
const url = `${settings.add_plugin_url}?${new URLSearchParams(data).toString()}`;
524-
return this.loadForm(url, iframe, el, onLoad, onSave);
524+
return this.loadPluginForm(url, iframe, el, onLoad, onSave);
525525
}
526526

527527
// CMS Editor: addPluginForm
@@ -535,10 +535,10 @@ class CMSEditor {
535535
cms_history: 0,
536536
};
537537
url = `${url}?${new URLSearchParams(data).toString()}`;
538-
return this.loadForm(url, iframe, el, onLoad, onSave);
538+
return this.loadPluginForm(url, iframe, el, onLoad, onSave);
539539
}
540540

541-
loadForm (url, iframe, el, onLoad, onSave) {
541+
loadPluginForm (url, iframe, el, onLoad, onSave) {
542542
iframe.addEventListener('load', () => {
543543
const form = iframe.contentDocument;
544544
const heading = form.querySelector('#content h1');
@@ -565,9 +565,7 @@ class CMSEditor {
565565
// Hook into the django CMS dataBridge to get the details of the newly created or saved
566566
// plugin. For new plugins we need their id to get the content.
567567

568-
if (!this.CMS.API.Helpers.dataBridge) {
569-
this.processDataBridge(form);
570-
}
568+
this.processDataBridge(form);
571569
// Needed to update StructureBoard
572570
if (onSave && this.CMS.API.Helpers.dataBridge) {
573571
onSave(el, form, this.CMS.API.Helpers.dataBridge);

tests/js/cms.editor.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('CMSEditor', () => {
6565
const el = document.getElementById('editor1');
6666
document.body.appendChild(iframe);
6767

68-
editor.loadForm('about:blank', iframe, el, () => {
68+
editor.loadPluginForm('about:blank', iframe, el, () => {
6969
expect(iframe.contentDocument).toBeTruthy();
7070
done();
7171
});

0 commit comments

Comments
 (0)