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

Add support for Plone 5/6 and Python 3 #13

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add support for Plone 5/6 and Python 3 #13

wants to merge 4 commits into from

Conversation

pbauer
Copy link
Member

@pbauer pbauer commented Mar 10, 2022

No description provided.

href="">
<img tal:replace="structure image/tag" />
</a>
</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems weird that image is removed here and in the renderer, but still in the item_display vocabulary. If intentional, should that be mentioned in the history?

@@ -82,7 +71,7 @@ class IContentPortlet(IPortletDataProvider):
value_type=schema.Choice(
vocabulary='collective.portlet.content.item_display_vocabulary',
),
default=[u'date', u'image', u'description', u'body'],
default=[u'date', u'description'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the point of this portlet to display the body?

more_text = u''
omit_border = False
custom_header = u""
omit_header = False

def __init__(self, portlet_title=u'', content=None, title_display=u'link',
item_display=[u'date', u'image', u'description', u'body'], more_text=u'',
item_display=[u'date', u'description'], more_text=u'',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mutable default is a code smell

@@ -149,7 +137,7 @@ def title(self):
"manage portlets" screen.
"""
msg = __(u"Content portlet")
return self.portlet_title or msg
return getattr(uuidToCatalogBrain(self.content), 'Title', None) or msg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should still use portlet_title if set, right?

@@ -226,17 +198,17 @@ def body(self):

# Currently nothing stops you from trying to get text from an Image
if hasattr(self.content, 'getText'):
text = self.content.getText()
text = self.content.getText
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The brain probably does not have getText; for this you probably need the real content item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants