Jump to content
  • [Beta 9.1] Disabled "AccountSettings" extensions throw an exception


    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.


    User Feedback

    Recommended Comments

    Esther E.

    Posted

    Quote

    Additionally, I'd like you to add a new extension function so we can override it and define a custom error for our needs

    Technically you can use the Loader extension with the customError() method for this.

    teraßyte

    Posted (edited)

    Right, I forgot about that one. We'd have to add a new Loader extension if we don't use it, and check the location, but I guess it can do. 👀

    Edited by teraßyte
    Esther E.

    Posted

    1 hour ago, teraßyte said:

    Right, I forgot about that one. We'd have to add a new Loader extension if we don't use it, and check the location, but I guess it can do. 👀

    Yeah, that will have to do for now. I actually did look at adding a custom message while I was fixing this, but it would require some refactoring, and now is not the time for that.


×
×
  • Create New...