Skip to content

Commit 0a62621

Browse files
committed
fix: non-breaking space replaced
1 parent 79f49e2 commit 0a62621

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

djangocms_alias/cms_plugins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def render_replace_response(self, request, new_plugins, source_placeholder=None,
326326
}
327327
if source_plugin and source_plugin.pk:
328328
data["replacedPlugin"] = get_plugin_toolbar_info(source_plugin)
329-
if source_placeholder is not None:
329+
if source_placeholder and source_placeholder.pk:
330330
data["replacedPlaceholder"] = {
331331
"placeholder_id": source_placeholder.pk,
332332
"deleted": True,

djangocms_alias/static/djangocms_alias/js/databridge.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const processDataBridge = function (data) {
44
let actionsPerformed = 0;
5-
window.parent.console.log('Processing data bridge:', data);
5+
66
if (data.replacedPlaceholder) {
77
CMS.API.StructureBoard.invalidateState('CLEAR_PLACEHOLDER', data.replacedPlaceholder);
88
actionsPerformed++;
@@ -29,7 +29,7 @@
2929
const iframe = window.parent.document.querySelector('.cms-modal-frame > iframe');
3030
const {CMS} = window.parent;
3131

32-
if (!iframe || !CMS) {
32+
if (!iframe || !CMS) {
3333
return;
3434
}
3535

@@ -38,7 +38,6 @@
3838
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
3939
const dataBridge = iframeDocument.body.querySelector('script#data-bridge');
4040
if (dataBridge) {
41-
window.parent.console.log('iframe loaded', dataBridge);
4241
try {
4342
const data = JSON.parse(dataBridge.textContent);
4443
if (data.action === 'ALIAS_REPLACE') {

0 commit comments

Comments
 (0)