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 UPDATE: the code search for the navroot, not the portal. The api for getting the navigatio root uses the same method but have some shortcut if plone.root is set in the registry, and basically uses get_navigation_root_object as suggested by @ale-rt I would use the api anyway. |
|
|
||
| self.context = current | ||
| self.__parent__ = current # Also update __parent__ to ensure consistency | ||
| request = self.request |
There was a problem hiding this comment.
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:
Most probably the issue lies elsewhere.
Gut feeling: I would check the styles viewlet.
|
I don't really think this fix is safe...I'm sure some sites are relying on being able to get the actual context where the exception occurred. Let's go back and look at the actual error. @dobri1408 what are the style URLs that it's trying to load which give a 404? |
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.