Commit 4c39d6c0 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Bug #5348 / Exception/Report: level key missing - implemented

parent 5f9d0cc9
......@@ -9,7 +9,7 @@ use qfq;
require_once(__DIR__ . '/../../qfq/qfq/QuickFormQuery.php');
require_once(__DIR__ . '/../../qfq/qfq/exceptions/UserFormException.php');
require_once(__DIR__ . '/../../qfq/qfq/exceptions/UserReportExtension.php');
require_once(__DIR__ . '/../../qfq/qfq/exceptions/UserReportException.php');
require_once(__DIR__ . '/../../qfq/qfq/exceptions/CodeException.php');
require_once(__DIR__ . '/../../qfq/qfq/exceptions/DbException.php');
......
......@@ -61,10 +61,9 @@ class AbstractException extends \Exception {
// $this->messageArray['Stacktrace'] = $this->getTrace();
$html .= "Code: " . htmlspecialchars($this->messageArray['Code']) . "<br>";
$html .= "Message: " . Support::wrapTag("<strong>", htmlspecialchars($this->messageArray['Message'])) . "<br>";
unset($this->messageArray['Code']);
$html .= 'Page Id: ' . $t3Vars[TYPO3_PAGE_ID] . '<br>';
$html .= 'Content Id: ' . $t3Vars[TYPO3_TT_CONTENT_UID] . '<br>';
$html .= "Message: " . Support::wrapTag("<strong>", htmlspecialchars($this->messageArray['Message'])) . "<br>";
// Form
if (isset($this->messageArray['Form']) && $this->messageArray['Form'] != '') {
......@@ -76,22 +75,36 @@ class AbstractException extends \Exception {
}
// Report
if (isset($this->messageArray[SYSTEM_REPORT_COLUMN_INDEX])) {
$html .= "Column index: " . Support::wrapTag("<strong>", htmlspecialchars($this->messageArray[SYSTEM_REPORT_COLUMN_INDEX])) . "<br>";
}
if (isset($this->messageArray[SYSTEM_REPORT_COLUMN_NAME])) {
$html .= "Column name: " . Support::wrapTag("<strong>", htmlspecialchars($this->messageArray[SYSTEM_REPORT_COLUMN_NAME])) . "<br>";
}
// if (isset($this->messageArray[SYSTEM_REPORT_COLUMN_INDEX])) {
// $html .= "Column index: " . Support::wrapTag("<strong>", htmlspecialchars($this->messageArray[SYSTEM_REPORT_COLUMN_INDEX])) . "<br>";
// }
//
// if (isset($this->messageArray[SYSTEM_REPORT_COLUMN_INDEX])) {
// $html .= "Column index: " . Support::wrapTag("<strong>", htmlspecialchars($this->messageArray[SYSTEM_REPORT_COLUMN_INDEX])) . "<br>";
// }
//
// if (isset($this->messageArray[SYSTEM_REPORT_COLUMN_NAME])) {
// $html .= "Column name: " . Support::wrapTag("<strong>", htmlspecialchars($this->messageArray[SYSTEM_REPORT_COLUMN_NAME])) . "<br>";
// }
//
// if (isset($this->messageArray[SYSTEM_REPORT_COLUMN_VALUE])) {
// $html .= "Column value: " . Support::wrapTag("<strong>", htmlspecialchars($this->messageArray[SYSTEM_REPORT_COLUMN_VALUE])) . "<br>";
// }
// Debug Information
if ($store !== null && Support::findInSet(SYSTEM_SHOW_DEBUG_INFO_YES, $store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM))) {
if (isset($this->messageArray[SYSTEM_REPORT_COLUMN_VALUE])) {
$html .= "Column value: " . Support::wrapTag("<strong>", htmlspecialchars($this->messageArray[SYSTEM_REPORT_COLUMN_VALUE])) . "<br>";
}
$type = $this->messageArray['Type'];
unset($this->messageArray['Type']);
if ($store !== null && Support::findInSet(SYSTEM_SHOW_DEBUG_INFO_YES, $store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM))) {
$stackTrace = $this->messageArray['Stacktrace'];
unset($this->messageArray['Stacktrace']);
$storeSystem = $store->getStore(STORE_SYSTEM);
$this->messageArray['current sip'] = $store->getStore(STORE_SIP);
$this->messageArray['Page Id'] = $t3Vars[TYPO3_PAGE_ID];
$this->messageArray['Content Id'] = $t3Vars[TYPO3_TT_CONTENT_UID];
// In case there is a 'form' name given in SIP, we probably have a problem in a form and a direct link to edit the broken form is helpful.
if (!empty($storeSystem[SYSTEM_FORM])) {
......@@ -99,8 +112,9 @@ class AbstractException extends \Exception {
$htmlForm = "Form: " . $renderedUrl . "<br>";
}
// Layout
$debug = '<tr bgcolor="#dddddd"><td colspan="2">Exception</td></tr>';
$debug = "<thead><tr><th>Exception</th><th>$type</th></tr></thead>";
foreach ($this->messageArray as $key => $value) {
// Array to string
if (is_array($value)) {
......@@ -112,7 +126,9 @@ class AbstractException extends \Exception {
}
}
$debug = '<table border=1 class="qfq-table-100">' . $debug . "</table>";
$debug = '<table class="table table-hover qfq-table-100">' . $debug . "</table>";
// Stracktrace
}
$html = "<h2>Error</h2>" . Support::wrapTag('<p>', $html . $htmlForm);
......
......@@ -32,6 +32,7 @@ class DbException extends AbstractException {
$this->messageArray['SQL before evaluation'] = Store::getVar(SYSTEM_SQL_RAW, STORE_SYSTEM);
$this->messageArray['SQL final'] = Store::getVar(SYSTEM_SQL_FINAL, STORE_SYSTEM);
$this->messageArray['SQL Params'] = Store::getVar(SYSTEM_SQL_PARAM_ARRAY, STORE_SYSTEM);
$this->messageArray['Report level key'] = Store::getVar(SYSTEM_REPORT_FULL_LEVEL, STORE_SYSTEM);
return parent::formatException();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment