DPDBeNeLux / magento2-shipping

Let op: er zijn nieuwe DPD plugins (BETA versie) beschikbaar met belangrijke nieuwe functionaliteiten. De oude plugins zullen na Brexit niet meer goed functioneren, download daarom de nieuwe versie op Github/DPDconnect.
GNU General Public License v3.0
12 stars 15 forks source link

Not working on a Fresh install via composer on M2.3.1 #37

Closed onepack closed 5 years ago

onepack commented 5 years ago

Magento: setup:upgrade result: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database.dpd_shipment_label' doesn't exist, query was: DESCRIBE dpd_shipment_label

On the frontend: 1 exception(s): Exception #0 (Magento\Framework\Exception\LocalizedException): Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory. The following modules are outdated: DPDBenelux_Shipping schema: current version - none, required version - 1.1.1 DPDBenelux_Shipping data: current version - none, required version - 1.1.1

Stuck in a circle.

onepack commented 5 years ago

I'm amazed that a company like DPD is not able to create a working module for their business. How is this tested before release?

dpdplugin commented 5 years ago

Hi @onepack , We regret that you are having this experience with our modules. We couldn't reproduce this on a fresh 2.3.1 instance, could you please give us the exact commands you ran when installing Magento and the module?

onepack commented 5 years ago

Magento: 2.3.1 PHP: 7.1 Developer mode. SSH: first I did a composer:update to get all latest packages Then: setup:upgrade Then: composer require dpdbenelux/magento2-shipping Then: php bin/magento setup:upgrade The I get the DPD error message during setup:upgrade: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database.dpd_shipment_label' doesn't exist, query was: DESCRIBE dpd_shipment_label So DPD install fails. There is nothing more to it.

It is quite clear that the table .dpd_shipment_label is not generated. This is probably because this is a brand new install and the part of the install/ setup script that is responsible for creating this table is probably skipped.

I disabled the module now.

onepack commented 5 years ago

I see in the install/update code that the part where the label table gets created is conditionally loaded. It seems there is a check for version 1.1.1, in the last part, that this current version is. So The last check will not work on a new install. It only becomes 1.1.1 after the setup was successful if I'm not mistaken.

onepack commented 5 years ago

I commented the last part of the setup script from line 370 till 381. vendor/dpdbenelux/magento2-shipping/Setup/UpgradeSchema.php

After that I changed the database table dpd_shipment_label by hand. And added the label_path. I was able to run a setup:update after that. It's working now. I can see DPD in the backend of the shop under settings.

dpdplugin commented 5 years ago

Hi,

We are still unable to reproduce this issue, could you run these exact comments? ` composer create-project --repository=https://repo.magento.com/ magento/project-community-edition

php bin/magento setup:install

composer require dpdbenelux/magento2-shipping

composer update dpdbenelux/magento2-shipping

php bin/magento module:enable DPDBenelux_Shipping

php bin/magento setup:upgrade

php bin/magento setup:di:compile

php bin/magento setup:static-content:deploy `

onepack commented 5 years ago

If you cannot reproduce this issue then just close it. I got it working now anyway with the workaround.