diff --git a/core/components/quip/model/quip/quip.class.php b/core/components/quip/model/quip/quip.class.php index b64ce61..c17c74b 100644 --- a/core/components/quip/model/quip/quip.class.php +++ b/core/components/quip/model/quip/quip.class.php @@ -125,11 +125,21 @@ function __construct(modX &$modx,array $config = array()) { */ public function initDebug() { if ($this->modx->getOption('debug',$this->config,false)) { - error_reporting(E_ALL); ini_set('display_errors',true); - $this->modx->setLogTarget('HTML'); - $this->modx->setLogLevel(modX::LOG_LEVEL_ERROR); - - $debugUser = $this->config['debugUser'] == '' ? $this->modx->user->get('username') : 'anonymous'; + //error_reporting(E_ALL); + //ini_set('display_errors',true); + //$this->modx->setLogTarget('HTML'); + //$this->modx->setLogLevel(modX::LOG_LEVEL_ERROR); + + /* BUG: original code throws an error, when debugUser has not been set. Together with the (wrong) error + reporting settings above this caused the manager to be unusable in debug mode + */ + $debugUser = 'anonymous'; + if (isset($this->config['debugUser'])) { + if ($this->config['debugUser'] == '') { + $debugUser = $this->modx->user->get('username'); + } + } + $user = $this->modx->getObject('modUser',array('username' => $debugUser)); if ($user == null) { $this->modx->user->set('id',$this->modx->getOption('debugUserId',$this->config,1)); @@ -504,4 +514,4 @@ public function loadController($controller) { } return $this->controller; } -} \ No newline at end of file +}