Skip to content

Conversation

@dobri1408
Copy link

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:
Screenshot 2025-11-13 at 16 47 31

However, when accessing https://classic.demo.plone.org/en/sandbox/not-found, the CSS is broken and the page renders incorrectly:
Screenshot 2025-11-13 at 16 47 56

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.

@mister-roboto
Copy link

@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:

@jenkins-plone-org please run jobs

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!

@dobri1408
Copy link
Author

@jenkins-plone-org please run jobs

@yurj
Copy link
Contributor

yurj commented Nov 26, 2025

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

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:

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

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.

7 participants