I was testing an AccountSettings extension in my application and I disable it based on a specific value.
Disabling it means I return NULL inside getTab() based on the value, however, if the URL is accessed directly the page throws an exception instead of a proper error:
Whoops\Exception\ErrorException thrown with message "Undefined variable $output" Stacktrace: #5 Whoops\Exception\ErrorException in \applications\core\modules\front\system\settings.php:152 #4 Whoops\Run:handleError in \applications\core\modules\front\system\settings.php:152 #3 IPS\core\modules\front\system\settings:manage in \system\Dispatcher\Controller.php:139 #2 IPS\Dispatcher\Controller:execute in \applications\core\modules\front\system\settings.php:104 #1 IPS\core\modules\front\system\settings:execute in \system\Dispatcher\Dispatcher.php:169 #0 IPS\Dispatcher:run in \index.php:16
The code should return an error if the tab is not accessible. Additionally, I'd like you to add a new extension function so we can override it and define a custom error for our needs.
Recommended Comments