Closed kharanenka closed 4 years ago
Tested this and it seems to only be an issue on the installation, after they're installed they work just fine. Might be some sort of race condition where the required plugin's autoload file is not loaded before the requiring plugin runs its migrations? Seemed to only happen in the completeInstall step, in $this->updatePlugin() of the update() method of the UpdateManager class.
@bennothommo could you take a look?
@LukeTowers when you tested this, what was installed first? Shopaholic or Toolbox?
@bennothommo Shopaholic and then Toolbox. Note that some of the migrations worked but some of the ones related to the settings section seem to have failed because navigating to the settings pages for the plugin give me table not found errors.
@LukeTowers ah I see, so it might indeed be a race condition. Toolbox should be installed first because it is the dependency. That being said, plugins are not supposed to be loaded in any update functionality, which is why there's a different outcome when the plugin is elevated.
@kharanenka does Shopaholic rely on Toolbox as part of the migrations?
Hi @bennothommo ! Yes, some plugin migrations of Shopaholic plugin add tables and transfer data. Data transfer is associated with calling of model class objects. The model class contains traits from Toolbox plugin. Traits are installed as composer packages in Toolbox plugin.
@kharanenka Thanks for the info. So in that case, it's definitely a race condition in that Shopaholic is installed first, and its migrations run, before Toolbox. We'll get a fix ready for it in build 467 which should hopefully be out within a week or two. In the meantime, you may need to instruct your users to install Toolbox first, then Shopaholic.
Thanks for quick fix! Have a nice day
@kharanenka can you test out #5120?
Description:
After change in modules\system\classes\PluginManager.php (line 229), file /vendor/autoload.php from plugin is not registered. Therefore, if you install Lovata.Shopaholic plugin from backend, an "Class not found" or "Trait not found" error occurs, because installed packages from Lovata.Toolbox plugin are not included.
The error does not reproduce if you install Lovata.Shopaholic plugin through
php artisan plugin:install Lovata.Shopaholic
command.The error does not reproduce if
public $elevated = true
flag is set in Plugin.php file of Lovata.Toolbox plugin.Plugins works successfully in 465 kernel version. We, as plugin developers, receive reports from our customers, because they cannot install plugins. We must be sure that there are no problems in our plugin.
Steps To Reproduce: