-
-
Notifications
You must be signed in to change notification settings - Fork 204
Fix broken CSS on 404 pages inside private folders #4237
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
base: master
Are you sure you want to change the base?
Conversation
|
@dobri1408 thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment: To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
|
@jenkins-plone-org please run jobs |
|
Hi! Just to ask: the plone root object should already be cached somewhere in a variable, the API plone.api.portal.get() uses getSite() which usually is locally cached in the Zope thread. But maybe I'm missing some details. See this discussion: https://community.plone.org/t/getting-the-portal-easy-and-quick/15493 |
|
|
||
| self.context = current | ||
| self.__parent__ = current # Also update __parent__ to ensure consistency | ||
| request = self.request |
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.
This might cause issues on some set up.
If I understand it correctly, you want to get the navigation root.
I would check if it works with:
from plone.base.navigationroot import get_navigation_root_object
In addition, this might break the suggestion:
Products.CMFPlone/src/Products/CMFPlone/browser/templates/error_message.pt
Lines 43 to 44 in 2122f8b
| <tal:suggestions define="first_parent redirection_view/find_first_parent; | |
| similar_items redirection_view/search_for_similar; |
Most probably the issue lies elsewhere.
Gut feeling: I would check the styles viewlet.
There is a bug right now in plone:
There is currently a bug in Plone:
When accessing

https://classic.demo.plone.org/en/demo/not-found, the site correctly returns a 404 page:
However, when accessing https://classic.demo.plone.org/en/sandbox/not-found, the CSS is broken and the page renders incorrectly:

It seems this issue appears because “sandbox” is a private folder, and the 404 page is trying to load resources that are not publicly accessible. I attempted a fix that works, but since I’m not primarily a Plone Python developer, someone more experienced may need to review and refine it. Still, this likely requires attention, as the issue affects the default error handling.