lyra / plugin-magento

An open source plugin that links Magento based e-commerce websites to PayZen secure payment gateway developed by Lyra Network.
https://lyra.com/fr/guides/magento/
Open Software License 3.0
10 stars 12 forks source link

Failure to install module on an empty Magento #3

Closed shavounet closed 6 years ago

shavounet commented 6 years ago

Test case

Exception trace: () at /var/www/html/vendor/magento/module-eav/Setup/EavSetup.php:267 Magento\Eav\Setup\EavSetup->getEntityTypeId() at /var/www/html/vendor/magento/module-eav/Setup/EavSetup.php:809 Magento\Eav\Setup\EavSetup->addAttribute() at /var/www/html/app/code/Lyranetwork/Payzen/Setup/InstallData.php:70 Lyranetwork\Payzen\Setup\InstallData->install() at /var/www/html/setup/src/Magento/Setup/Model/Installer.php:867 Magento\Setup\Model\Installer->handleDBSchemaData() at /var/www/html/setup/src/Magento/Setup/Model/Installer.php:791 Magento\Setup\Model\Installer->installDataFixtures() at n/a:n/a call_user_func_array() at /var/www/html/setup/src/Magento/Setup/Model/Installer.php:342 Magento\Setup\Model\Installer->install() at /var/www/html/setup/src/Magento/Setup/Console/Command/InstallCommand.php:127 Magento\Setup\Console\Command\InstallCommand->execute() at /var/www/html/vendor/symfony/console/Command/Command.php:242 Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/symfony/console/Application.php:843 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:193 Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/magento/framework/Console/Cli.php:104 Magento\Framework\Console\Cli->doRun() at /var/www/html/vendor/symfony/console/Application.php:117 Symfony\Component\Console\Application->run() at /var/www/html/bin/magento:23



This is due to `$entityTypeId = $customerInstaller->getEntityTypeId('customer');` not existing at this moment

Proposed fix
----------------

Add the right module sequence in `etc/module.xml` to force waiting for Customer module to be installed. Note that I haven't tested it more, but there is insertions on `sales_order_status` tables ; you should also add a sequence for those.
shavounet commented 6 years ago

I've opened the PR #4 that successfully fix this issue on my local env.

nabil509 commented 6 years ago

Okay, thank you. I will accept this PR very soon. I am working on a fix version 2.1.4 for the plugin.

nabil509 commented 6 years ago

PR merged to develop. I close the issue.