Closed mirkocesaro closed 3 years ago
Thank you for this excellent report and for including the underlying reason!
In my local env, I work with a dev module required by composer. It is added in the config.php file as active and pushed it. The pipeline, to deploy the code on the server, uses the composer install --no-dev and remove the module from the vendor but the module is still in config.php file.
Very interesting and useful! 🎉 Now I can add the type-cast to the code without without having a bad feeling about it :)
I am working on Magento 2.4.1 and I found this error in my log while I visit an admin page with Hyva-admin grid:
and, of course, the grid is not visible.
This is related to a module not registered with the module registrar but also present in the
config.php
file.How this is possible?
In my local env, I work with a dev module required by composer. It is added in the
config.php
file as active and pushed it. The pipeline, to deploy the code on the server, uses thecomposer install --no-dev
and remove the module from the vendor but the module is still inconfig.php
file.I have to check the pipeline to understand why the
bin/magento setup:upgrade --keep-generated
does not remove the dev modules. But I open the issue here anyway because could be useful to fix it.How to reproduce it
Add an unexistent module to the
config.php
, clean the config cache and open an admin page with the hyva grid.Workaround
As @Vinai suggested to me, add an explicit type conversion to \Hyva\Admin\Model\Config\HyvaConfigDirs::moduleDir method like:
Stack trace: