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
Subsitelogoviewlet should only search for logo on subsite #99
Conversation
…ation root is a subsite
dbdb9aa
to
44a0eaa
Compare
@@ -18,13 +19,15 @@ def __init__(self, context, request, view, manager=None): | |||
def update(self): | |||
super(SubsiteLogoViewlet, self).update() | |||
|
|||
portal = self.portal_state.portal() | |||
portal = api.portal.get_navigation_root(self.context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to rename portal
to navigationroot
or short navroot
because a subsite is actually not the portal.
@jone didn't think about that. Thanks 😃 Should be fine now |
portal = self.portal_state.portal() | ||
navroot = api.portal.get_navigation_root(self.context) | ||
is_subsite = bool(navroot.portal_type == 'ftw.subsite.Subsite') | ||
|
||
self.navigation_root_url = self.portal_state.navigation_root_url() | ||
|
||
subsite_logo = getattr(self.context, 'logo', None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raphael-s This does no solve the origin problem. self.context
, needs to be replaces with navroot
logoName = portal.restrictedTraverse('base_properties').logoName | ||
logo_alt_text = portal.getProperty('logo_alt_text', '') | ||
self.logo_tag = portal.restrictedTraverse(logoName).tag( | ||
logoName = navroot.restrictedTraverse('base_properties').logoName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbaechtold revert... this is the fallback.
This makes the
subsitelogoviewlet
only search for a logo when the navigation root of the context actually is a subsite.This led to some really weird things happening to a site when a content with the id
logo
got created. (No logo, JS not working etc).