Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tinymce format icon names #321

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/3095.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update TinyMCE format icon names.
[petschki]
4 changes: 2 additions & 2 deletions plone/app/upgrade/v60/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@
<!-- Plone 6.0.10 -->

<gs:upgradeStep
title="Miscellaneous"
handler="..utils.null_upgrade_step"
title="Fix TinyMCE format icon names"
handler=".final.fix_tinymce_format_iconnames"
/>

</gs:upgradeSteps>
Expand Down
20 changes: 20 additions & 0 deletions plone/app/upgrade/v60/final.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,23 @@ def fix_syndication_settings(context):
key = f"{old_iface}.{fieldname}"
if key in record_keys:
del registry.records[key]


def fix_tinymce_format_iconnames(context):
"""Fix 'strike-through' and 'sourcecode'.

See https://github.com/plone/Products.CMFPlone/issues/3905
"""
registry = getUtility(IRegistry)
record = registry.records.get("plone.inline_styles")
if record is None:
return
values = record.value
replacements = [
("Strikethrough|strikethrough|strikethrough", "Strikethrough|strikethrough|strike-through"),
("Code|code|code", "Code|code|sourcecode")
]
for _old, _new in replacements:
if _old in values:
values[values.index(_old)] = _new
record.value = values