From d6c221fcc003b2af67e4cbafcf24fc76a5eac6e2 Mon Sep 17 00:00:00 2001 From: Dobricean Ioan Dorian <50819975+dobri1408@users.noreply.github.com> Date: Thu, 13 Nov 2025 16:37:33 +0200 Subject: [PATCH 1/4] fix css on private parent page 404 --- src/Products/CMFPlone/browser/exceptions.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Products/CMFPlone/browser/exceptions.py b/src/Products/CMFPlone/browser/exceptions.py index 0d843bf93b..fdd8280dc9 100644 --- a/src/Products/CMFPlone/browser/exceptions.py +++ b/src/Products/CMFPlone/browser/exceptions.py @@ -30,7 +30,23 @@ 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__ + print(f"DEBUG: Starting context: {current}") + print(f"DEBUG: Starting context path: {getattr(current, 'absolute_url_path', lambda: 'NO PATH')()}") + + while hasattr(current, '__parent__') and current.__parent__ is not None: + if hasattr(current, 'meta_type') and current.meta_type == 'Plone Site': + print(f"DEBUG: Found Plone Site at: {current}") + break + current = current.__parent__ + print(f"DEBUG: Moving up to: {current}") + + self.context = current + self.__parent__ = current # Also update __parent__ to ensure consistency + print(f"DEBUG: Final context: {self.context}") + print(f"DEBUG: Final __parent__: {self.__parent__}") + print(f"DEBUG: Final context path: {getattr(self.context, 'absolute_url_path', lambda: 'NO PATH')()}") request = self.request exc_type, value, traceback = sys.exc_info() From e4900681233de67a1761ee902eea35e34cec42bd Mon Sep 17 00:00:00 2001 From: Dobricean Ioan Dorian <50819975+dobri1408@users.noreply.github.com> Date: Thu, 13 Nov 2025 16:43:13 +0200 Subject: [PATCH 2/4] fix css on private parent page 404 --- src/Products/CMFPlone/browser/exceptions.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Products/CMFPlone/browser/exceptions.py b/src/Products/CMFPlone/browser/exceptions.py index fdd8280dc9..a43f1a0f1b 100644 --- a/src/Products/CMFPlone/browser/exceptions.py +++ b/src/Products/CMFPlone/browser/exceptions.py @@ -32,21 +32,13 @@ def __call__(self): # Always use portal root as context to ensure resources load correctly current = self.__parent__ - print(f"DEBUG: Starting context: {current}") - print(f"DEBUG: Starting context path: {getattr(current, 'absolute_url_path', lambda: 'NO PATH')()}") - while hasattr(current, '__parent__') and current.__parent__ is not None: if hasattr(current, 'meta_type') and current.meta_type == 'Plone Site': - print(f"DEBUG: Found Plone Site at: {current}") break current = current.__parent__ - print(f"DEBUG: Moving up to: {current}") self.context = current self.__parent__ = current # Also update __parent__ to ensure consistency - print(f"DEBUG: Final context: {self.context}") - print(f"DEBUG: Final __parent__: {self.__parent__}") - print(f"DEBUG: Final context path: {getattr(self.context, 'absolute_url_path', lambda: 'NO PATH')()}") request = self.request exc_type, value, traceback = sys.exc_info() From 072285d79de044bef8070eb56e4b002380f5557d Mon Sep 17 00:00:00 2001 From: dobri1408 <50819975+dobri1408@users.noreply.github.com> Date: Thu, 13 Nov 2025 16:59:51 +0200 Subject: [PATCH 3/4] Fix string quotes in exceptions.py --- src/Products/CMFPlone/browser/exceptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Products/CMFPlone/browser/exceptions.py b/src/Products/CMFPlone/browser/exceptions.py index a43f1a0f1b..7d4797e9c1 100644 --- a/src/Products/CMFPlone/browser/exceptions.py +++ b/src/Products/CMFPlone/browser/exceptions.py @@ -32,8 +32,8 @@ def __call__(self): # 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': + 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__ From 43722b05553e3ee4ada91b88e733bd759cbf0c7c Mon Sep 17 00:00:00 2001 From: dobri1408 <50819975+dobri1408@users.noreply.github.com> Date: Thu, 13 Nov 2025 17:00:22 +0200 Subject: [PATCH 4/4] Create 4237.bugfix.md --- news/4237.bugfix.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/4237.bugfix.md diff --git a/news/4237.bugfix.md b/news/4237.bugfix.md new file mode 100644 index 0000000000..8e5ffa17e7 --- /dev/null +++ b/news/4237.bugfix.md @@ -0,0 +1 @@ +Fix broken CSS on 404 pages inside private folders @dobri1408