Fixed bug with plugin status on install/uninstall#29
Fixed bug with plugin status on install/uninstall#29ppalex7 wants to merge 1 commit intoGameConnect:masterfrom
Conversation
Saving plugin status as 'installed'/'uninstalled' only if corresponding action finished properly Also added messages for successful and failed plugin installation.
|
I don't think this is necessary, as you can see in the Community Bans plugin, the new way is to throw an exception. The error message is then returned via AJAX. The documentation in SBPlugin just wasn't updated. |
|
Maybe, but why if I return false from runInstall - plugin will marked as installed? |
|
Why break something that already works? Or if you think, that throwing exception - is only right way - you should edit documentation of SBPlugin model in the part of "return value of runInstall or runUninstall functions" |
Because it doesn't check for false anymore, it checks whether an exception was thrown.
Sure, returning false worked, except that you had no idea what went wrong. Now you actually get an error message.
I don't think it's the only right way, but for now it's the easiest way to stop the installation and return an error message. Especially since Yii also throws exceptions for SQL errors and such. Maybe in the future we'll want to return multiple error messages, then we can reconsider how it's implemented. I updated the documentation in commit 7b145fb. |
At 95ac85c plugin installation system was broken, and saves status of installation/deinstallation as 'success' in all cases. I fixed it.
Saving plugin status as 'installed'/'uninstalled' only if corresponding action finished properly
Also added messages for failed plugin installation.