Skip to content

Commit

Permalink
Add fix for issue with KeysToHide and older versions of Tracy core.
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbj committed Jan 16, 2025
1 parent e8fdab3 commit 716f427
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions TracyDebugger.module.php
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ public static function getModuleInfo() {
'summary' => __('Tracy debugger from Nette with many PW specific custom tools.', __FILE__),
'author' => 'Adrian Jones',
'href' => 'https://processwire.com/talk/forum/58-tracy-debugger/',
'version' => '4.26.52',
'version' => '4.26.53',
'autoload' => 100000, // in PW 3.0.114+ higher numbers are loaded first - we want Tracy first
'singular' => true,
'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4',
@@ -950,8 +950,9 @@ public function init() {
$locations = array_map('constant', $this->data['showLocation']);
Debugger::$showLocation = array_reduce($locations, function($a, $b) { return $a | $b; }, 0);


Debugger::$keysToHide = array_map('trim', explode(',', $this->data['keysToHide']));
if(version_compare(PHP_VERSION, '7.2.0', '>=')) {
Debugger::$keysToHide = array_map('trim', explode(',', $this->data['keysToHide']));
}


// START ENABLING TRACY
@@ -3462,13 +3463,15 @@ public function getModuleConfigInputfields(array $data) {
$f->attr('checked', $data['debugInfo'] == '1' ? 'checked' : '');
$fieldset->add($f);

$f = $this->wire('modules')->get("InputfieldText");
$f->attr('name', 'keysToHide');
$f->label = __('Keys to hide', __FILE__);
$f->description = __('Keys to redact in dumps and bluescreens.', __FILE__);
$f->notes = __('Enter keys separated by commas.'."\nDefault: ".self::getDefaultData()['keysToHide'], __FILE__);
if($data['keysToHide']) $f->attr('value', $data['keysToHide']);
$fieldset->add($f);
if(version_compare(PHP_VERSION, '7.2.0', '>=')) {
$f = $this->wire('modules')->get("InputfieldText");
$f->attr('name', 'keysToHide');
$f->label = __('Keys to hide', __FILE__);
$f->description = __('Keys to redact in dumps and bluescreens.', __FILE__);
$f->notes = __('Enter keys separated by commas.'."\nDefault: ".self::getDefaultData()['keysToHide'], __FILE__);
if($data['keysToHide']) $f->attr('value', $data['keysToHide']);
$fieldset->add($f);
}

$f = $this->wire('modules')->get("InputfieldInteger");
$f->attr('name', 'maxDepth');

0 comments on commit 716f427

Please sign in to comment.