From a8411b8834faad9bd6adf1d722962f18bb2089ff Mon Sep 17 00:00:00 2001 From: Tibor Szakmany Date: Wed, 29 May 2024 08:48:05 +0200 Subject: [PATCH] upgrade 216: do not purge existing icon values --- src/plone/staticresources/upgrades/216.zcml | 24 ++++--------------- .../staticresources/upgrades/__init__.py | 21 ++++++++++++++++ .../profiles/216/registry/icons_plone.xml | 18 -------------- 3 files changed, 26 insertions(+), 37 deletions(-) delete mode 100644 src/plone/staticresources/upgrades/profiles/216/registry/icons_plone.xml diff --git a/src/plone/staticresources/upgrades/216.zcml b/src/plone/staticresources/upgrades/216.zcml index 528414b0c..fb7551e4a 100644 --- a/src/plone/staticresources/upgrades/216.zcml +++ b/src/plone/staticresources/upgrades/216.zcml @@ -3,26 +3,12 @@ xmlns:gs="http://namespaces.zope.org/genericsetup" > - - - - - - - + title="Import PLIP 3211 icon changes" + profile="plone.staticresources:default" + handler=".upgrade_v215_to_v216" + /> diff --git a/src/plone/staticresources/upgrades/__init__.py b/src/plone/staticresources/upgrades/__init__.py index e69de29bb..71000dd23 100644 --- a/src/plone/staticresources/upgrades/__init__.py +++ b/src/plone/staticresources/upgrades/__init__.py @@ -0,0 +1,21 @@ +from plone import api +from plone.registry import field +from plone.registry.record import Record + + +def upgrade_v215_to_v216(context): + """Import missing icons.""" + + registry = api.portal.get_tool('portal_registry') + + if 'plone.icon.plone-rearrange' not in registry.records: + registry.records['plone.icon.plone-rearrange'] = Record( + field.TextLine(title='Plone Icon rearrange'), + '++plone++bootstrap-icons/sort-down-alt.svg' + ) + + if 'plone.icon.plone-selection' not in registry.records: + registry.records['plone.icon.plone-selection'] = Record( + field.TextLine(title='Plone Icon selection'), + '++plone++bootstrap-icons/list-ul.svg' + ) diff --git a/src/plone/staticresources/upgrades/profiles/216/registry/icons_plone.xml b/src/plone/staticresources/upgrades/profiles/216/registry/icons_plone.xml deleted file mode 100644 index 8cc0f8eac..000000000 --- a/src/plone/staticresources/upgrades/profiles/216/registry/icons_plone.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - Plone Icon rearrange - - ++plone++bootstrap-icons/sort-down-alt.svg - - - - - Plone Icon selection - - ++plone++bootstrap-icons/list-ul.svg - - -