Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions core/components/quip/model/quip/quip.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -504,4 +514,4 @@ public function loadController($controller) {
}
return $this->controller;
}
}
}