Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/4237.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix broken CSS on 404 pages inside private folders @dobri1408
10 changes: 9 additions & 1 deletion src/Products/CMFPlone/browser/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ def __call__(self):
# and sets the proper location header
return

self.context = self.__parent__
# Always use portal root as context to ensure resources load correctly
current = self.__parent__
while hasattr(current, "__parent__") and current.__parent__ is not None:
if hasattr(current, "meta_type") and current.meta_type == "Plone Site":
break
current = current.__parent__

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.


exc_type, value, traceback = sys.exc_info()
Expand Down