You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've came across this when using collective.lineage but I think this should be fixed here. Lineage basically only marks a folder as IObjectManagerSite and takes care of the persistent components registered to the base site.
Testsetup
Create /Plone site
Create a Folder Subsite and mark it as IChildSite
Inside the subsite create a page Testpage, go to @@manage-aliases and add an alias /supertestpage
In the existing aliases there's the new entry /subsite/supertestpage
What I expect
Redirect the path /subsite/supertestpage to /subsite/testpage
check if the provided alias is within a "navigationrooted" folder and add its path (if not already provided by the user) -> that's correct because plone_portal_state.portal_url() correctly traverses to ISiteRoot which is /Plone and plone_portal_state.navigation_root_url() is /Plone/subsite so the result is /subsite/supertestpage
try to "absolutize" the path with the Plone portal path -> since this checks with zope.component.hooks.getSite it gets our IObjectSiteManager and you end up with the absolutized path /Plone/subsite/subsite/supertestpage
I've came across this when using
collective.lineage
but I think this should be fixed here. Lineage basically only marks a folder asIObjectManagerSite
and takes care of the persistent components registered to the base site.Testsetup
/Plone
siteSubsite
and mark it asIChildSite
Testpage
, go to@@manage-aliases
and add an alias/supertestpage
/subsite/supertestpage
What I expect
Redirect the path
/subsite/supertestpage
to/subsite/testpage
What really happens
The logic of the aliases browser view (https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/controlpanel/browser/redirects.py#L132) is:
plone_portal_state.portal_url()
correctly traverses toISiteRoot
which is/Plone
andplone_portal_state.navigation_root_url()
is/Plone/subsite
so the result is/subsite/supertestpage
zope.component.hooks.getSite
it gets ourIObjectSiteManager
and you end up with the absolutized path/Plone/subsite/subsite/supertestpage
Solution
Use
plone_portal_state.portal()
to determine the absoluteISiteRoot
path here https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/controlpanel/browser/redirects.py#L51Workaround
Add the redirects in
@@redirection-controlpanel
with the paths/subsite/supertestpage
->/subsite/testpage
The text was updated successfully, but these errors were encountered: