Skip to content

Commit

Permalink
Merge pull request #170 from plone/remove-highlightsearchterms
Browse files Browse the repository at this point in the history
Remove jquery-highlightsearchterms and plone_ecmascript layer
  • Loading branch information
jensens authored Sep 9, 2018
2 parents 96fa24e + 0c1c1ee commit 8d8f25d
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ New features:
- Add upgrade steps for Datatbles on Plone 5.1.4
[frapell]

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

Bug fixes:

- *add item here*
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')
15 changes: 13 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,29 @@
<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>

<!-- Update legacy bundle -->
<records prefix="plone.bundles/plone-legacy"
interface='Products.CMFPlone.interfaces.IBundleRegistry'>
<value key="last_compilation"></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>
8 changes: 8 additions & 0 deletions plone/app/upgrade/v52/alphas.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
from plone.app.upgrade.utils import cleanUpSkinsTool
from plone.app.upgrade.utils import loadMigrationProfile
from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName
from zope.component import getUtility

import logging

Expand All @@ -13,3 +15,9 @@ def to52alpha1(context):
loadMigrationProfile(context, 'profile-plone.app.upgrade.v52:to52alpha1')
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')
16 changes: 16 additions & 0 deletions plone/app/upgrade/v52/profiles/to_alpha1/registry.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<registry>


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

<!-- Update legacy bundle -->
<records prefix="plone.bundles/plone-legacy"
interface='Products.CMFPlone.interfaces.IBundleRegistry'>
<value key="last_compilation"></value>
</records>

</registry>
8 changes: 8 additions & 0 deletions plone/app/upgrade/v52/profiles/to_alpha1/skins.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@
<skin-path name="*">
<layer name="plone_login" remove="True"/>
</skin-path>
<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 8d8f25d

Please sign in to comment.