Commit 3d45c4e4 authored by Carsten  Rose's avatar Carsten Rose
Browse files

#3545 / Errormessages via API/JSON not displayed

The new class T3info() was fine, but relying classes assumed that all array elements always exist. This was not given in the past. The new implemention creates at least an empty entry for each element.
AbstractException.php: removed garbage line.
save.php: require_once missing PHP Exception classes.
T3Info.php: recode.
parent 0c1a3e5b
......@@ -13,6 +13,9 @@ use qfq;
require_once(__DIR__ . '/../qfq/QuickFormQuery.php');
require_once(__DIR__ . '/../qfq/store/Store.php');
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/exceptions/UserFormException.php');
require_once(__DIR__ . '/../qfq/exceptions/CodeException.php');
require_once(__DIR__ . '/../qfq/exceptions/DbException.php');
/**
......
......@@ -49,7 +49,6 @@ class AbstractException extends \Exception {
// Respect mode: 'form load' (plain HTML), 'Ajax alert'
$this->messageArray['Stacktrace'] = $this->getTraceAsString();
// $this->messageArray['Stacktrace'] = $this->getTrace();
$arr = require_once(__DIR__ . '/../../qfq/store/T3Info.php');
$html .= "Code: " . htmlspecialchars($this->messageArray['Code']) . "<br>";
$html .= "Message: " . Support::wrapTag("<strong>", htmlspecialchars($this->messageArray['Message'])) . "<br>";
......
......@@ -19,33 +19,19 @@ class T3Info {
public static function getVars() {
$t3vars = array();
if (isset($GLOBALS["TSFE"]->fe_user->user["username"])) {
$t3vars[TYPO3_FE_USER] = $GLOBALS["TSFE"]->fe_user->user["username"];
}
$t3vars[TYPO3_FE_USER] = isset($GLOBALS["TSFE"]->fe_user->user["username"]) ? $GLOBALS["TSFE"]->fe_user->user["username"] : '';
if (isset($GLOBALS["TSFE"]->fe_user->user["uid"])) {
$t3vars[TYPO3_FE_USER_UID] = $GLOBALS["TSFE"]->fe_user->user["uid"];
}
$t3vars[TYPO3_FE_USER_UID] = isset($GLOBALS["TSFE"]->fe_user->user["uid"]) ? $GLOBALS["TSFE"]->fe_user->user["uid"] : '';
if (isset($GLOBALS["TSFE"]->fe_user->user["usergroup"])) {
$t3vars[TYPO3_FE_USER_GROUP] = $GLOBALS["TSFE"]->fe_user->user["usergroup"];
}
$t3vars[TYPO3_FE_USER_GROUP] = isset($GLOBALS["TSFE"]->fe_user->user["usergroup"]) ? $GLOBALS["TSFE"]->fe_user->user["usergroup"] : '';
if (isset($GLOBALS["TSFE"]->page["uid"])) {
$t3vars[TYPO3_TT_CONTENT_UID] = $GLOBALS["TSFE"]->page["uid"];
}
$t3vars[TYPO3_TT_CONTENT_UID] = isset($GLOBALS["TSFE"]->page["uid"]) ? $GLOBALS["TSFE"]->page["uid"] : '';
if (isset($GLOBALS["TSFE"]->id)) {
$t3vars[TYPO3_PAGE_ID] = $GLOBALS["TSFE"]->id;
}
$t3vars[TYPO3_PAGE_ID] = isset($GLOBALS["TSFE"]->id) ? $GLOBALS["TSFE"]->id : '';
if (isset($GLOBALS["TSFE"]->type)) {
$t3vars[TYPO3_PAGE_TYPE] = $GLOBALS["TSFE"]->type;
}
$t3vars[TYPO3_PAGE_TYPE] = isset($GLOBALS["TSFE"]->type) ? $GLOBALS["TSFE"]->type : '';
if (isset($GLOBALS["TSFE"]->sys_language_uid)) {
$t3vars[TYPO3_PAGE_LANGUAGE] = $GLOBALS["TSFE"]->sys_language_uid;
}
$t3vars[TYPO3_PAGE_LANGUAGE] = isset($GLOBALS["TSFE"]->sys_language_uid) ? $GLOBALS["TSFE"]->sys_language_uid : '';
return $t3vars;
}
......
Supports Markdown
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