Skip to content

Commit

Permalink
Also remove the jquery-highlightsearchterms resource, and the plone_e…
Browse files Browse the repository at this point in the history
…cmascript skin layer for plone 5.1.4
  • Loading branch information
sunew committed Sep 6, 2018
1 parent 6bab181 commit c979968
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ New features:
[frapell]

- Add upgrade step removing the jquery-highlightsearchterms resource
and the plone_ecmascript skin layer, on Plone 5.2
and the plone_ecmascript skin layer, on Plone 5.2 and 5.1.4

Bug fixes:

Expand Down
2 changes: 1 addition & 1 deletion plone/app/upgrade/v51/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ Add image scaling options to image handling control panel.
<gs:upgradeStep
title="Miscellaneous"
description=""
handler="..utils.null_upgrade_step"
handler=".final.remove_highlightsearchterms"
/>

</gs:upgradeSteps>
Expand Down
14 changes: 14 additions & 0 deletions plone/app/upgrade/v51/final.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# -*- coding: utf-8 -*-
from plone.app.upgrade.utils import cleanUpSkinsTool
from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName
from zExceptions import BadRequest
from zope.component import getUtility

import logging

Expand Down Expand Up @@ -38,3 +41,14 @@ def fix_i18n_domain(context):
'Action object/%s does not have an i18n_domain property',
action_id,
)


def remove_highlightsearchterms(context):
portal = getToolByName(context, 'portal_url').getPortalObject()
cleanUpSkinsTool(portal)

registry = getUtility(IRegistry)
record = 'plone.bundles/plone-legacy.resources'
resources = registry.records[record]
if u'jquery-highlightsearchterms' in resources.value:
resources.value.remove(u'jquery-highlightsearchterms')
9 changes: 7 additions & 2 deletions plone/app/upgrade/v51/profiles/to_514/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,23 @@
<value key="js">++plone++static/components/datatables.net-select/js/dataTables.select.min.js</value>
</records>

<records prefix="plone.resources/jquery-highlightsearchterms"
interface='Products.CMFPlone.interfaces.IResourceRegistry'
remove="True">
</records>

<!-- Update ``last_compilation`` to deliver new bundles -->
<records
prefix="plone.bundles/plone"
interface="Products.CMFPlone.interfaces.IBundleRegistry"
purge="False">
<value key="last_compilation">2018-07-10 00:00:00</value>
<value key="last_compilation">2018-09-06 00:00:00</value>
</records>
<records
prefix="plone.bundles/plone-logged-in"
interface="Products.CMFPlone.interfaces.IBundleRegistry"
purge="False">
<value key="last_compilation">2018-07-10 00:00:00</value>
<value key="last_compilation">2018-09-06 00:00:00</value>
</records>

</registry>
11 changes: 11 additions & 0 deletions plone/app/upgrade/v51/profiles/to_514/skins.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<object name="portal_skins">
<object
name="plone_ecmascript"
meta_type="Filesystem Directory View"
directory="Products.CMFPlone:skins/plone_ecmascript"
remove="True"/>
<skin-path name="*">
<layer name="plone_ecmascript" remove="True"/>
</skin-path>
</object>

0 comments on commit c979968

Please sign in to comment.