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

Do not use eea.api.taxonomy because it is deprecated #287

Merged
merged 8 commits into from
Dec 5, 2024
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
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
6.2.25 (unreleased)
-------------------

- Nothing changed yet.
- Do not use eea.api.taxonomy because it is deprecated.
[cekk]


6.2.24 (2024-11-26)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"redturtle.bandi",
"z3c.unconfigure",
"plone.restapi",
"eea.api.taxonomy",
"collective.taxonomy>=3.1",
"openpyxl",
"collective.volto.enhancedlinks",
],
Expand Down
7 changes: 7 additions & 0 deletions src/design/plone/contenttypes/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@
directory="profiles/fix_syndication"
/>

<genericsetup:registerProfile
name="remove_eea_api_taxonomy"
title="Uninstall eea.api.taxonomy"
description=""
provides="Products.GenericSetup.interfaces.EXTENSION"
directory="profiles/remove_eea_api_taxonomy"
/>
<utility
factory=".setuphandlers.HiddenProfiles"
name="design.plone.contenttypes-hiddenprofiles"
Expand Down
1 change: 1 addition & 0 deletions src/design/plone/contenttypes/overrides.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
Products.ZCatalog.interfaces.IZCatalog"
name="SearchableText"
/>

</unconfigure>

</configure>
9 changes: 0 additions & 9 deletions src/design/plone/contenttypes/patches/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,4 @@

<include package="collective.monkeypatcher" />

<monkey:patch
original="__call__"
replacement=".patches.eea_api_taxonomy_taxonomy_call"
class="collective.taxonomy.utility.Taxonomy"
description="Patch Taxonomy class caller"
order="2000"
preserveOriginal="true"
/>

</configure>
10 changes: 0 additions & 10 deletions src/design/plone/contenttypes/patches/patches.py
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
# -*- coding: utf-8 -*-
from collective.taxonomy.vocabulary import Vocabulary


def eea_api_taxonomy_taxonomy_call(self, context):
if not self.data:
return Vocabulary(self.name, {}, {}, {}, 2)

request = getattr(context, "REQUEST", None)
language = self.getCurrentLanguage(request)
return self.makeVocabulary(language)
4 changes: 2 additions & 2 deletions src/design/plone/contenttypes/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<version>7308</version>
<version>7309</version>
<dependencies>
<dependency>profile-redturtle.bandi:default</dependency>
<dependency>profile-collective.venue:default</dependency>
<dependency>profile-redturtle.volto:default</dependency>
<dependency>profile-eea.api.taxonomy:default</dependency>
<dependency>profile-collective.z3cform.datagridfield:default</dependency>
<dependency>profile-design.plone.contenttypes:taxonomy</dependency>
<dependency>profile-collective.volto.enhancedlinks:default</dependency>
<dependency>profile-collective.taxonomy:default</dependency>
</dependencies>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<layers>
<layer name="eea.api.taxonomy" remove="true" />
</layers>
3 changes: 0 additions & 3 deletions src/design/plone/contenttypes/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import collective.volto.enhancedlinks
import collective.z3cform.datagridfield
import design.plone.contenttypes
import eea.api.taxonomy
import kitconcept.seo
import plone.app.caching
import plone.formwidget.geolocation
Expand All @@ -43,7 +42,6 @@ def setUpZope(self, app, configurationContext):
)
self.loadZCML(package=redturtle.bandi)
self.loadZCML(package=kitconcept.seo)
self.loadZCML(package=eea.api.taxonomy)
self.loadZCML(package=collective.taxonomy)
self.loadZCML(package=collective.z3cform.datagridfield)

Expand Down Expand Up @@ -75,7 +73,6 @@ def setUpZope(self, app, configurationContext):
self.loadZCML(package=collective.volto.enhancedlinks)
self.loadZCML(package=design.plone.contenttypes, context=configurationContext)
self.loadZCML(package=plone.formwidget.geolocation)
self.loadZCML(package=eea.api.taxonomy)
self.loadZCML(package=collective.taxonomy)
self.loadZCML(package=collective.z3cform.datagridfield)
xmlconfig.file(
Expand Down
7 changes: 7 additions & 0 deletions src/design/plone/contenttypes/upgrades/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -912,4 +912,11 @@
destination="7308"
handler=".to_730x.to_7308"
/>
<genericsetup:upgradeStep
title="Uninstall eea.api.taxonomy"
profile="design.plone.contenttypes:default"
source="7308"
destination="7309"
handler=".to_730x.to_7309"
/>
</configure>
8 changes: 8 additions & 0 deletions src/design/plone/contenttypes/upgrades/to_730x.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,11 @@ def to_7308(context):
if i % 15 == 0:
logger.info("Progress: {}/{}".format(i, tot))
brain.getObject().reindexObject(idxs=["effectivestart"])


def to_7309(context):
ps = api.portal.get_tool(name="portal_setup")
ps.runAllImportStepsFromProfile(
"profile-design.plone.contenttypes:remove_eea_api_taxonomy"
)
ps.unsetLastVersionForProfile("eea.api.taxonomy:default")
1 change: 1 addition & 0 deletions test-6.0.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ extends =
base.cfg

[versions]
collective.taxonomy = 3.1.5
Loading