From ca2b0736f61c38be1cda726b7f84586ee65a9d73 Mon Sep 17 00:00:00 2001 From: Steffen Gebert <steffen.gebert@typo3.org> Date: Sat, 26 Mar 2011 12:41:15 +0100 Subject: [PATCH] [FEATURE] Link Exception messages to Wiki pages Add a text and link to the Exception handler messages pointing to a page on typo3.org. Change-Id: Ibbbd34657869cd9f0e5703124af4b4cc7673a679 Resolves: #M16271 Reviewed-on: http://review.typo3.org/1282 Reviewed-by: Helmut Hummel Tested-by: Helmut Hummel Reviewed-by: Steffen Kamper Reviewed-by: Philipp Gampe Reviewed-by: Susanne Moog Tested-by: Susanne Moog --- t3lib/config_default.php | 2 +- .../error/class.t3lib_error_debugexceptionhandler.php | 9 ++------- .../class.t3lib_error_productionexceptionhandler.php | 10 +++++++++- .../stylesheets/standalone/errorpage-message.css | 4 ++++ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/t3lib/config_default.php b/t3lib/config_default.php index 99587bd68e6c..c098ad58aba6 100644 --- a/t3lib/config_default.php +++ b/t3lib/config_default.php @@ -650,7 +650,7 @@ $typo_db_extTableDef_script = ''; // The filename of an additional script in typ define('TYPO3_URL_GENERAL', 'http://typo3.com/'); define('TYPO3_URL_ORG', 'http://typo3.org/'); define('TYPO3_URL_LICENSE', 'http://typo3.org/license'); -define('TYPO3_URL_EXCEPTION', 'http://typo3.org/go/exception/'); +define('TYPO3_URL_EXCEPTION', 'http://typo3.org/go/exception/v4/'); define('TYPO3_URL_MAILINGLISTS', 'http://lists.typo3.org/cgi-bin/mailman/listinfo'); define('TYPO3_URL_DOCUMENTATION', 'http://typo3.org/documentation/'); define('TYPO3_URL_DOCUMENTATION_TSREF', 'http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/'); diff --git a/t3lib/error/class.t3lib_error_debugexceptionhandler.php b/t3lib/error/class.t3lib_error_debugexceptionhandler.php index 68103a9fda60..cd834145f6c5 100644 --- a/t3lib/error/class.t3lib_error_debugexceptionhandler.php +++ b/t3lib/error/class.t3lib_error_debugexceptionhandler.php @@ -60,12 +60,7 @@ class t3lib_error_DebugExceptionHandler extends t3lib_error_AbstractExceptionHan $exceptionCodeNumber = ($exception->getCode() > 0) ? '#' . $exception->getCode() . ': ' : ''; - /** - * TODO: 25.09.2009 - * either remove this line or let the link point to site that offers error information for TYPO3 - */ - - // $moreInformationLink = ($exceptionCodeNumber != '') ? '(<a href="' . TYPO3_URL_EXCEPTION . $exception->getCode() . '">More information</a>)' : ''; + $moreInformationLink = ($exceptionCodeNumber != '') ? '(<a href="' . TYPO3_URL_EXCEPTION . 'debug/' . $exception->getCode() . '" target="_blank">More information</a>)' : ''; $backtraceCode = $this->getBacktraceCode($exception->getTrace()); $this->writeLogEntries($exception, self::CONTEXT_WEB); @@ -120,7 +115,7 @@ class t3lib_error_DebugExceptionHandler extends t3lib_error_AbstractExceptionHan "> <div style="width: 100%; background-color: #515151; color: white; padding: 2px; margin: 0 0 6px 0;">Uncaught TYPO3 Exception</div> <div style="width: 100%; padding: 2px; margin: 0 0 6px 0;"> - <strong style="color: #BE0027;">' . $exceptionCodeNumber . $exception->getMessage() . '</strong> ' . /* $moreInformationLink .*/ + <strong style="color: #BE0027;">' . $exceptionCodeNumber . $exception->getMessage() . '</strong> ' . $moreInformationLink . '<br /> <br /> <span class="ExceptionProperty">' . get_class($exception) . '</span> thrown in file<br /> diff --git a/t3lib/error/class.t3lib_error_productionexceptionhandler.php b/t3lib/error/class.t3lib_error_productionexceptionhandler.php index 724b209e1c94..d6576c44a07e 100644 --- a/t3lib/error/class.t3lib_error_productionexceptionhandler.php +++ b/t3lib/error/class.t3lib_error_productionexceptionhandler.php @@ -53,8 +53,16 @@ class t3lib_error_ProductionExceptionHandler extends t3lib_error_AbstractExcepti header("HTTP/1.1 500 Internal Server Error"); } $this->writeLogEntries($exception, self::CONTEXT_WEB); + + if ($exception->getCode() > 0) { + $moreInformationLink = '<p>More information regarding this error might be available <a href="' + . TYPO3_URL_EXCEPTION . $exception->getCode() . '" target="_blank">online</a>.</p>'; + } else { + $moreInformationLink = ''; + } + // we use a nice-looking title for our visitors instead of the exception's class name - $messageObj = t3lib_div::makeInstance('t3lib_message_ErrorPageMessage', $exception->getMessage(), 'Oops, an error occured!'); + $messageObj = t3lib_div::makeInstance('t3lib_message_ErrorPageMessage', $exception->getMessage() . $moreInformationLink, 'Oops, an error occured!'); $messageObj->output(); } diff --git a/typo3/sysext/t3skin/stylesheets/standalone/errorpage-message.css b/typo3/sysext/t3skin/stylesheets/standalone/errorpage-message.css index cbefba850480..afc8afe600e9 100644 --- a/typo3/sysext/t3skin/stylesheets/standalone/errorpage-message.css +++ b/typo3/sysext/t3skin/stylesheets/standalone/errorpage-message.css @@ -79,6 +79,10 @@ body { font-weight: bold; } +.t3-message-page p { + margin-bottom: 1em; +} + #t3-footer { border-top: 1px solid #5c5c5c; font-size: 10px; -- GitLab