diff --git a/Products/CMFPlone/browser/exceptions.py b/Products/CMFPlone/browser/exceptions.py index 7a03a14d09..581543cd29 100644 --- a/Products/CMFPlone/browser/exceptions.py +++ b/Products/CMFPlone/browser/exceptions.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- from AccessControl import getSecurityManager -from OFS.interfaces import IApplication from Products.Five import BrowserView from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zExceptions.ExceptionFormatter import format_exception +from zope.component.hooks import getSite import json import sys @@ -34,8 +34,8 @@ def __call__(self): 'error_type': error_type, }) - if IApplication.providedBy(self.context): - # The context is the Zope-root, so we cannot render our template + if getSite() is None: + # We cannot get the site, so we cannot render our nice template template = self.basic_template else: # Use a simplified template if main_template is not available diff --git a/Products/CMFPlone/browser/templates/basic_error_message.pt b/Products/CMFPlone/browser/templates/basic_error_message.pt index 80539837ec..11acb313ee 100644 --- a/Products/CMFPlone/browser/templates/basic_error_message.pt +++ b/Products/CMFPlone/browser/templates/basic_error_message.pt @@ -5,17 +5,33 @@ lang="en" i18n:domain="plone"> + + - ${options/error_type} + Error + ${options/error_type} -

${options/error_type}

-

We're sorry, but there seems to be an error.

+

+ We’re sorry, but there seems to be an error… +

+ +

${options/error_type}

- - + +

+ If you are certain you have the correct web address but are encountering an error, please + contact the site administration. +

+
+ + +