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

Subsitelogoviewlet should only search for logo on subsite #99

Merged
merged 2 commits into from Nov 28, 2016

Conversation

raphael-s
Copy link
Contributor

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).

@raphael-s raphael-s force-pushed the rs-SubsiteLogoViewletOnlyOnSubsite branch from dbdb9aa to 44a0eaa Compare November 25, 2016 12:46
@@ -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)
Copy link
Member

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.

@raphael-s
Copy link
Contributor Author

@jone didn't think about that. Thanks 😃

Should be fine now

@jone jone merged commit 3f09a56 into master Nov 28, 2016
@jone jone deleted the rs-SubsiteLogoViewletOnlyOnSubsite branch November 28, 2016 09:56
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)
Copy link
Contributor

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
Copy link
Contributor

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.

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

3 participants