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

Update resources for plone.app.event #166

Merged
merged 3 commits into from
Sep 14, 2018
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 CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Bug fixes:

- *add item here*

- Update resources for plone.app.event. [agitator]


2.0.15 (2018-06-21)
-------------------
Expand Down
2 changes: 2 additions & 0 deletions plone/app/upgrade/v50/alphas.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def to50alpha1(context):
qi = getToolByName(portal, 'portal_quickinstaller')
else:
qi = get_installer(portal)
if not qi.isProductInstalled('plone.resource'):
qi.installProduct('plone.resource')
if not qi.isProductInstalled('plone.app.event'):
qi.installProduct('plone.app.event')

Expand Down
12 changes: 9 additions & 3 deletions plone/app/upgrade/v51/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,18 @@ Add image scaling options to image handling control panel.
destination="5113"
profile="Products.CMFPlone:plone">

<gs:upgradeDepends
title="Run to513 upgrade profile."
description="Update resources for plone.app.event"
import_profile="plone.app.upgrade.v51:to513"
/>

<gs:upgradeStep
title="Miscellaneous"
description=""
handler="..utils.null_upgrade_step"
title="Force remove old p.a.event resources"
handler=".final.remove_old_PAE_rescources"
/>


</gs:upgradeSteps>

<gs:upgradeSteps
Expand Down
10 changes: 10 additions & 0 deletions plone/app/upgrade/v51/final.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@ def remove_highlightsearchterms(context):
resources = registry.records[record]
if u'jquery-highlightsearchterms' in resources.value:
resources.value.remove(u'jquery-highlightsearchterms')


def remove_old_PAE_rescources(context): # noqa
"""FORCE remove old p.a.event resources"""
registry = getUtility(IRegistry)
resources = registry.records['plone.bundles/plone-legacy.resources']
if u'resource-plone-app-event-event-js' in resources.value:
resources.value.remove('resource-plone-app-event-event-js')
if u'resource-plone-app-event-event-css' in resources.value:
resources.value.remove('resource-plone-app-event-event-css')
9 changes: 9 additions & 0 deletions plone/app/upgrade/v51/profiles.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:registerProfile
name="to513"
title="Upgrade profile for Plone 5.1.2 to Plone 5.1.3"
description=""
directory="profiles/to_513"
for="Products.CMFPlone.interfaces.IMigratingPloneSiteRoot"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:registerProfile
name="to514"
title="Upgrade profile for Plone 5.1.3 to Plone 5.1.4"
Expand Down
26 changes: 26 additions & 0 deletions plone/app/upgrade/v51/profiles/to_513/registry.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<registry>

<!-- remove old resources and update legacy bundle -->
<records prefix="plone.resources/resource-plone-app-event-js" remove="True"
interface='Products.CMFPlone.interfaces.IResourceRegistry'>
</records>
<records prefix="plone.resources/resource-plone-app-event-css" remove="True"
interface='Products.CMFPlone.interfaces.IResourceRegistry'>
</records>

<!-- register as resource for legacy bundle -->
<records prefix="plone.resources/plone-app-event"
interface='Products.CMFPlone.interfaces.IResourceRegistry'>
<value key="js">++plone++plone.app.event/event.js</value>
</records>

<records prefix="plone.bundles/plone-legacy"
interface='Products.CMFPlone.interfaces.IBundleRegistry'>
<value key="resources" purge="False">
<element>plone-app-event</element>
</value>
<value key="last_compilation"></value>
</records>

</registry>