Skip to content

Commit

Permalink
Fix for errors in Request Info panel for some core module settings pa…
Browse files Browse the repository at this point in the history
…ges.
  • Loading branch information
adrianbj committed Feb 21, 2018
1 parent 097d4a4 commit 9baef12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion TracyDebugger.module
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule {
'summary' => __('Tracy debugger from Nette with several PW specific custom tools.', __FILE__),
'author' => 'Adrian Jones',
'href' => 'https://processwire.com/talk/topic/12208-tracy-debugger/',
'version' => '4.9.18',
'version' => '4.9.19',
'autoload' => true,
'singular' => true,
'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4',
Expand Down
11 changes: 9 additions & 2 deletions panels/RequestInfoPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,14 @@ public function getPanel() {
if($this->wire('input')->get('name') && $this->wire('page')->process == 'ProcessModule') {
$moduleName = $this->wire('sanitizer')->name($this->wire('input')->get('name'));
if($this->wire('modules')->isInstalled($moduleName)) {
$module = $this->wire('modules')->get($moduleName);
// get was causing problems with some core modules like ProcessPageEdit and ProcessPageEditImageSelect
// resulting in a "No page specified" error
try {
$moduleConfigData = $this->wire('modules')->get($moduleName);
}
catch(\Exception $e) {
$moduleConfigData = $this->wire('modules')->getModuleConfigData($moduleName);
}
$moduleSettings = '
<table>';
foreach($this->wire('modules')->getModuleInfoVerbose($moduleName) as $k => $v) {
Expand All @@ -178,7 +185,7 @@ public function getPanel() {
</tr>
';
}
foreach($module->getArray() as $k => $v) {
foreach($moduleConfigData as $k => $v) {
$moduleSettings .= '
<tr>
<td>'.$k.'</td>
Expand Down

0 comments on commit 9baef12

Please sign in to comment.