Skip to content

Commit

Permalink
Merge pull request #43 from eea/develop
Browse files Browse the repository at this point in the history
Release 5.1
  • Loading branch information
avoinea authored Oct 17, 2024
2 parents 8aae704 + 2cc88b4 commit 2deda09
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

5.1 - (2024-10-17)
---------------------------
* Fix: disable other_organisations behavior on all content types
[laszlocseh]

4.3 - (2024-10-01)
---------------------------
* Change: Fix other organisations metadata
Expand Down
2 changes: 1 addition & 1 deletion eea/coremetadata/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<version>4.0</version>
<version>5.1</version>
<dependencies>
<dependency>profile-collective.taxonomy:default</dependency>
</dependencies>
Expand Down
9 changes: 9 additions & 0 deletions eea/coremetadata/upgrades/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,13 @@
profile="eea.coremetadata:default"
/>

<genericsetup:upgradeStep
title="Disable EEA Coremetadata Organisations behavior on all content types"
description=""
source="5.0"
destination="5.1"
handler=".to_51.to_51"
profile="eea.coremetadata:default"
/>

</configure>
17 changes: 17 additions & 0 deletions eea/coremetadata/upgrades/to_51.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

""" Upgrade to 5.1 """
from plone.dexterity.interfaces import IDexterityFTI
from plone import api
from zope.component import queryUtility


def to_51(context):
"""Disable EEA Coremetadata Organisations behavior on all content types"""

portal_types = api.portal.get_tool(name='portal_types')
for fti_id in portal_types.objectIds():
fti = queryUtility(IDexterityFTI, name=fti_id)

if fti and 'other_organisations' in fti.behaviors:
fti.behaviors = [
b for b in fti.behaviors if b != 'other_organisations']
2 changes: 1 addition & 1 deletion eea/coremetadata/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3
5.1

0 comments on commit 2deda09

Please sign in to comment.