From 9baef12f64cb4ba1ee29b57f5ea4ffa384f10691 Mon Sep 17 00:00:00 2001 From: adrianbj Date: Tue, 20 Feb 2018 16:43:44 -0800 Subject: [PATCH] Fix for errors in Request Info panel for some core module settings pages. --- TracyDebugger.module | 2 +- panels/RequestInfoPanel.php | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/TracyDebugger.module b/TracyDebugger.module index abbcc18f..07efce78 100644 --- a/TracyDebugger.module +++ b/TracyDebugger.module @@ -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', diff --git a/panels/RequestInfoPanel.php b/panels/RequestInfoPanel.php index c8006e69..f9892f3c 100644 --- a/panels/RequestInfoPanel.php +++ b/panels/RequestInfoPanel.php @@ -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 = ' '; foreach($this->wire('modules')->getModuleInfoVerbose($moduleName) as $k => $v) { @@ -178,7 +185,7 @@ public function getPanel() { '; } - foreach($module->getArray() as $k => $v) { + foreach($moduleConfigData as $k => $v) { $moduleSettings .= '
'.$k.'