Skip to content

Commit

Permalink
Addjust for django CMS 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Feb 17, 2025
1 parent cf3fac6 commit 0daa499
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions djangocms_text/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def get_messages(self, request):

@classmethod
@lru_cache
def get_child_plugin_candidates(cls, slot, page):
def get_child_plugin_candidates(cls, slot:str, page=None, template=None):
"""
This method is a class method that returns a list of child plugin candidates for a given slot and page.
Expand Down Expand Up @@ -608,7 +608,7 @@ def get_child_plugin_candidates(cls, slot, page):
return text_enabled_plugins

@staticmethod
def render_plugin_icon(plugin):
def render_plugin_icon(plugin: CMSPluginBase):
icon = getattr(plugin, "text_icon", None)
if icon is None:
return
Expand Down
3 changes: 3 additions & 0 deletions djangocms_text/contrib/text_ckeditor4/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from djangocms_text.editors import RTEConfig

from cms.utils.urlutils import static_with_version


ckeditor4 = RTEConfig(
name="ckeditor4",
config="CKEDITOR",
js=(
static_with_version("cms/js/dist/bundle.admin.base.min.js"),
"djangocms_text/vendor/ckeditor4/ckeditor.js",
"djangocms_text/bundles/bundle.ckeditor4.min.js",
),
Expand Down
9 changes: 0 additions & 9 deletions djangocms_text/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@
from .editors import DEFAULT_TOOLBAR_CMS, DEFAULT_TOOLBAR_HTMLField, get_editor_base_config, get_editor_config
from .utils import admin_reverse, cms_placeholder_add_plugin

try:
from cms.utils.urlutils import static_with_version
except ModuleNotFoundError: # pragma: no cover

def static_with_version(path):
return path


rte_config = get_editor_config()
#: The configuration for the text editor widget

Expand Down Expand Up @@ -106,7 +98,6 @@ def media(self):
),
},
js=(
static_with_version("cms/js/dist/bundle.admin.base.min.js"),
"djangocms_text/bundles/bundle.editor.min.js",
*rte_config.js,
),
Expand Down
2 changes: 1 addition & 1 deletion private/js/cms.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ class CMSEditor {
}
}
// Additional content for the page disrupts inline editing and needs to be removed
delete this.CMS.API.Helpers.dataBridge.content;
delete this.CMS.API.Helpers.dataBridge.structure.content;

if (this.CMS.settings.version.startsWith('3.')) {
/* Reflect dirty flag in django CMS < 4 */
Expand Down

0 comments on commit 0daa499

Please sign in to comment.