diff --git a/CHANGES.rst b/CHANGES.rst index 85f4547b..7d4d7a88 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,7 +6,8 @@ Changelog - Fix bug search event restapi (#148) [mamico] - +- Use custom creator criteria to list only creators present in the catalog to avoid an empty list when using LDAP and many_users flag + [folix-01] 5.9.3 (2025-11-24) ------------------ diff --git a/src/redturtle/volto/configure.zcml b/src/redturtle/volto/configure.zcml index 00c6d078..468a1f02 100644 --- a/src/redturtle/volto/configure.zcml +++ b/src/redturtle/volto/configure.zcml @@ -13,6 +13,7 @@ + diff --git a/src/redturtle/volto/profiles/default/registry/criteria.xml b/src/redturtle/volto/profiles/default/registry/criteria.xml index 327be94e..2b22fce1 100644 --- a/src/redturtle/volto/profiles/default/registry/criteria.xml +++ b/src/redturtle/volto/profiles/default/registry/criteria.xml @@ -17,4 +17,8 @@ Metadata + + redturtle.volto.vocabularies.Creators + + diff --git a/src/redturtle/volto/upgrades.py b/src/redturtle/volto/upgrades.py index d466f259..7120817f 100644 --- a/src/redturtle/volto/upgrades.py +++ b/src/redturtle/volto/upgrades.py @@ -6,11 +6,14 @@ from plone.app.linkintegrity.handlers import getObjectsFromLinks from plone.app.linkintegrity.handlers import updateReferences from plone.app.linkintegrity.interfaces import IRetriever +from plone.app.querystring.interfaces import IQueryField from plone.app.upgrade.utils import installOrReinstallProduct from plone.dexterity.utils import iterSchemata +from plone.registry.interfaces import IRegistry from plone.restapi.behaviors import IBlocks from redturtle.volto.setuphandlers import remove_custom_googlebot from uuid import uuid4 +from zope.component import getUtility from zope.schema import getFields @@ -631,6 +634,14 @@ def to_4500(context): portal_types["Plone Site"].behaviors = tuple(behaviors) +def to_4501(context): + registry = getUtility(IRegistry) + settings = registry.forInterface( + IQueryField, prefix="plone.app.querystring.field.Creator" + ) + settings.vocabulary = "redturtle.volto.vocabularies.Creators" + + def to_4600(context): portal_types = api.portal.get_tool(name="portal_types") portal_types["Plone Site"].default_view = "homepage_view" diff --git a/src/redturtle/volto/upgrades.zcml b/src/redturtle/volto/upgrades.zcml index f5bc6972..7a49d366 100644 --- a/src/redturtle/volto/upgrades.zcml +++ b/src/redturtle/volto/upgrades.zcml @@ -272,6 +272,14 @@ destination="4500" handler=".upgrades.to_4500" /> + + + + + diff --git a/src/redturtle/volto/vocabularies/principals.py b/src/redturtle/volto/vocabularies/principals.py new file mode 100644 index 00000000..91f0ad79 --- /dev/null +++ b/src/redturtle/volto/vocabularies/principals.py @@ -0,0 +1,11 @@ +from plone.app.vocabularies.catalog import KeywordsVocabulary +from zope.interface import implementer +from zope.schema.interfaces import IVocabularyFactory + + +@implementer(IVocabularyFactory) +class CreatorsVocabulary(KeywordsVocabulary): + keyword_index = "Creator" + + +CreatorsVocabularyFactory = CreatorsVocabulary()