pegasus
Well-known member
- Affected version
- 2.0.7
The CLI variation of add-on:install does the following:
This can leave a forum in an unusable state, until class-extensions and code-event listeners are disabled via XenForo's config.php and the add-on is removed manually.
If any step in the install/upgrade of an add-on fails with an exception, then the entire CLI script should abort, not proceed to the next step.
Easy enough to reproduce. Create an add-on with at least 1 XML item that will be imported. Create a setup class with an install method of only line which throws an exception. The exception will be thrown but the XML items will be imported and built anyway.
The problem appears to be that XF\Error::displayFatalExceptionMessage does not set the status code to 255. After adding exit(255) to the end of that method, the CLI action aborts as expected.
- Run the install method(s) of the add-on's setup class
- Run add-on:import
- Run add-on:post-install
This can leave a forum in an unusable state, until class-extensions and code-event listeners are disabled via XenForo's config.php and the add-on is removed manually.
If any step in the install/upgrade of an add-on fails with an exception, then the entire CLI script should abort, not proceed to the next step.
Easy enough to reproduce. Create an add-on with at least 1 XML item that will be imported. Create a setup class with an install method of only line which throws an exception. The exception will be thrown but the XML items will be imported and built anyway.
The problem appears to be that XF\Error::displayFatalExceptionMessage does not set the status code to 255. After adding exit(255) to the end of that method, the CLI action aborts as expected.
Last edited: