bitExpert / magento2-force-login

Force Customer Login Module for Magento 2
https://marketplace.magento.com/bitexpert-magento2-force-customer-login.html
Apache License 2.0
166 stars 73 forks source link

A whitelist entry is not editable Error after trying to update the module #230

Closed iranimij closed 6 months ago

iranimij commented 6 months ago

After updating the module from 4.1 to 5.3 and then after running bin/magento set:up, I receive this error.

Unable to apply data patch BitExpert\ForceCustomerLogin\Setup\Patch\Data\Patch501 for module BitExpert_ForceCustomerLogin. Original exception message: Whitelist entry not editable.

I took a look into it and found the source of the issue. The issue is that, previously we have added some records to the bitexpert_forcelogin_whitelist with editable 0 by default. (https://github.com/bitExpert/magento2-force-login/blob/7cdd89556ba2cfbadb38565f6405eeea94b7f43e/Setup/UpgradeData.php#L235C9-L241C11) using setup script and then in version 5 we return error if the editable is 0, and I think when we are making editable automatically 0 then we should not return exception in future https://github.com/bitExpert/magento2-force-login/blob/master/Repository/WhitelistRepository.php => line 79

Preconditions

Updating from Magento2-force-login version 4.1 to version 5.3 PHP 8.2

Magento Version : 2.4.6-p4

Force Login Module Version :

Third party modules :

Steps to reproduce

  1. Install module 4,1
  2. update to 5.1
  3. run bin/magento set:up

Expected result

  1. No error should we see. since everything is ok.

Actual result

  1. We receive an error :
  2. image

iranimij commented 6 months ago

I have prepared this pr for this issue : https://github.com/bitExpert/magento2-force-login/pull/231

shochdoerfer commented 6 months ago

Fixed in the 5.4.0 release which was just published https://github.com/bitExpert/magento2-force-login/releases/tag/v5.4.0