Skip to content

Commit

Permalink
upgrade 216: do not purge existing icon values
Browse files Browse the repository at this point in the history
  • Loading branch information
Tibor Szakmany committed May 29, 2024
1 parent df3b1fb commit a8411b8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 37 deletions.
24 changes: 5 additions & 19 deletions src/plone/staticresources/upgrades/216.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,12 @@
xmlns:gs="http://namespaces.zope.org/genericsetup"
>

<gs:registerProfile
name="216"
title="Import PLIP 3211 icon changes"
description="Imports plone-rearrange and plone-selection icons for migrated sites"
provides="Products.GenericSetup.interfaces.EXTENSION"
for="Products.CMFPlone.interfaces.IMigratingPloneSiteRoot"
directory="profiles/216"
/>

<gs:upgradeSteps
profile="plone.staticresources:default"
<gs:upgradeStep
source="215"
destination="216"
>

<gs:upgradeDepends
title="Import plone-rearrange and plone-selection icons"
import_profile="plone.staticresources.upgrades:216"
/>

</gs:upgradeSteps>
title="Import PLIP 3211 icon changes"
profile="plone.staticresources:default"
handler=".upgrade_v215_to_v216"
/>

</configure>
21 changes: 21 additions & 0 deletions src/plone/staticresources/upgrades/__init__.py
Original file line number Diff line number Diff line change
@@ -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'
)

This file was deleted.

0 comments on commit a8411b8

Please sign in to comment.