From c26b396ce0dee31c11abab244a7762d2b02865fa Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Fri, 24 Nov 2023 18:59:06 +0100 Subject: [PATCH] Fix ILeadImageBehavior and IRichTextBehavior interfaces were the name change was forgotten. --- CHANGES.rst | 4 ++-- docs/README.rst | 4 ++-- news/681.bugfix | 2 ++ plone/app/contenttypes/behaviors/viewlets.py | 6 +++--- plone/app/contenttypes/indexers.py | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 news/681.bugfix diff --git a/CHANGES.rst b/CHANGES.rst index 5156f68e..2d016261 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -456,7 +456,7 @@ Bug fixes: New features: -- Support ILeadImage behavior when display collection album view. +- Support ILeadImageBehavior when display collection album view. [rodfersou] (#524) - Add more log-messages during migration from AT to DX. [pbauer] (#526) @@ -535,7 +535,7 @@ Bug fixes: Breaking changes: -- ILeadImage and IRichText behaviors now have proper "Marker"-Interfaces. +- ILeadImageBehavior and IRichTextBehavior behaviors now have proper "Marker"-Interfaces. As this was only possible by renaming the schema adapter to *Behavior* to not break with implementations inside the collective, the FTI-behavior-definition has changed: diff --git a/docs/README.rst b/docs/README.rst index b3af8b62..84ad8b02 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -79,7 +79,7 @@ You have several options: - + @@ -91,7 +91,7 @@ You have several options: your.package.content:folder.xml - + diff --git a/news/681.bugfix b/news/681.bugfix new file mode 100644 index 00000000..31d52626 --- /dev/null +++ b/news/681.bugfix @@ -0,0 +1,2 @@ +Fix ILeadImageBehavior and IRichTextBehavior interfaces were the name change was forgotten. +[thet] diff --git a/plone/app/contenttypes/behaviors/viewlets.py b/plone/app/contenttypes/behaviors/viewlets.py index eb38dbb2..8fe6a8de 100644 --- a/plone/app/contenttypes/behaviors/viewlets.py +++ b/plone/app/contenttypes/behaviors/viewlets.py @@ -1,4 +1,4 @@ -from plone.app.contenttypes.behaviors.leadimage import ILeadImage +from plone.app.contenttypes.behaviors.leadimage import ILeadImageBehavior from plone.app.layout.viewlets import ViewletBase @@ -6,5 +6,5 @@ class LeadImageViewlet(ViewletBase): """A simple viewlet which renders leadimage""" def update(self): - self.context = ILeadImage(self.context) - self.available = True if self.context.image else False + behavior = ILeadImageBehavior(self.context) + self.available = True if behavior.image else False diff --git a/plone/app/contenttypes/indexers.py b/plone/app/contenttypes/indexers.py index a4e49517..973dfe83 100644 --- a/plone/app/contenttypes/indexers.py +++ b/plone/app/contenttypes/indexers.py @@ -1,6 +1,6 @@ from Acquisition import aq_base from logging import getLogger -from plone.app.contenttypes.behaviors.richtext import IRichText +from plone.app.contenttypes.behaviors.richtext import IRichTextBehavior from plone.app.contenttypes.interfaces import ICollection from plone.app.contenttypes.interfaces import IDocument from plone.app.contenttypes.interfaces import IFile @@ -40,7 +40,7 @@ def _unicode_save_string_concat(*args): def SearchableText(obj): text = "" - richtext = IRichText(obj, None) + richtext = IRichTextBehavior(obj, None) if richtext: textvalue = richtext.text if IRichTextValue.providedBy(textvalue):