Skip to content

Commit

Permalink
Merge pull request #681 from plone/fix-behavior-interfaces
Browse files Browse the repository at this point in the history
Fix ILeadImageBehavior and IRichTextBehavior interfaces were the name change was forgotten.
  • Loading branch information
mauritsvanrees authored Apr 23, 2024
2 parents 291de31 + c26b396 commit 4d0a239
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,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)
Expand Down Expand Up @@ -552,7 +552,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:
Expand Down
4 changes: 2 additions & 2 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ You have several options:
<?xml version="1.0"?>
<object name="Folder" meta_type="Dexterity FTI">
<property name="behaviors" purge="False">
<element value="plone.app.contenttypes.behaviors.leadimage.ILeadImage"/>
<element value="plone.leadimage"/>
</property>
</object>
Expand All @@ -91,7 +91,7 @@ You have several options:
<object name="Folder" meta_type="Dexterity FTI">
<property name="model_file">your.package.content:folder.xml</property>
<property name="behaviors" purge="False">
<element value="plone.app.contenttypes.behaviors.leadimage.ILeadImage"/>
<element value="plone.leadimage"/>
</property>
</object>
Expand Down
2 changes: 2 additions & 0 deletions news/681.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix ILeadImageBehavior and IRichTextBehavior interfaces were the name change was forgotten.
[thet]
6 changes: 3 additions & 3 deletions plone/app/contenttypes/behaviors/viewlets.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from plone.app.contenttypes.behaviors.leadimage import ILeadImage
from plone.app.contenttypes.behaviors.leadimage import ILeadImageBehavior
from plone.app.layout.viewlets import ViewletBase


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
4 changes: 2 additions & 2 deletions plone/app/contenttypes/indexers.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 4d0a239

Please sign in to comment.