Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into thet-staticresources
Browse files Browse the repository at this point in the history
  • Loading branch information
ale-rt committed Feb 6, 2019
2 parents ecbcb43 + acefa13 commit f4d8542
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plone/app/upgrade/v52/alphas.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def cleanup_resources():
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')

Expand Down
30 changes: 30 additions & 0 deletions plone/app/upgrade/v52/betas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
from Products.CMFCore.utils import getToolByName
from plone.app.upgrade.utils import loadMigrationProfile

import logging


logger = logging.getLogger('plone.app.upgrade')


def add_exclude_from_nav_index(context):
"""Add exclude_from_nav index to the portal_catalog.
"""
name = 'exclude_from_nav'
meta_type = 'BooleanIndex'
catalog = getToolByName(context, 'portal_catalog')
indexes = catalog.indexes()
indexables = []
if name not in indexes:
catalog.addIndex(name, meta_type)
indexables.append(name)
logger.info('Added %s for field %s.', meta_type, name)
if len(indexables) > 0:
logger.info('Indexing new indexes %s.', ', '.join(indexables))
catalog.manage_reindexIndex(ids=indexables)


def to52beta1(context):
loadMigrationProfile(context, 'profile-plone.app.upgrade.v52:to52beta1')
add_exclude_from_nav_index(context)
14 changes: 13 additions & 1 deletion plone/app/upgrade/v52/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

</gs:upgradeSteps>


<gs:upgradeSteps
source="5200"
destination="5201"
Expand All @@ -33,4 +32,17 @@

</gs:upgradeSteps>

<gs:upgradeSteps
source="5201"
destination="5202"
profile="Products.CMFPlone:plone">

<gs:upgradeStep
title="Run to52beta1 upgrade profile."
description=""
handler=".betas.to52beta1"
/>

</gs:upgradeSteps>

</configure>
9 changes: 9 additions & 0 deletions plone/app/upgrade/v52/profiles.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:registerProfile
name="to52beta1"
title="Upgrade profile for Plone 5.2alpha2 to Plone 5.2beta1"
description=""
directory="profiles/to_beta1"
for="Products.CMFPlone.interfaces.IMigratingPloneSiteRoot"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

</configure>
Empty file.
8 changes: 8 additions & 0 deletions plone/app/upgrade/v52/profiles/to_beta1/registry.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<registry>

<records interface="Products.CMFPlone.interfaces.controlpanel.INavigationSchema" prefix="plone" purge="False">
<value key="navigation_depth">1</value>
</records>

</registry>

0 comments on commit f4d8542

Please sign in to comment.