Description
Preconditions (*)
- Magento 2.4.3 (EE)
- Composer 2
Steps to reproduce (*)
Hi,
I am upgrading from Magento 2.4.2-p1 from Magento 2.4.3. Composer Update was working fine, but when I tried to run
php bin/magento setup:upgrade
I am getting the below error.
Unable to apply data patch Magento\Paypal\Setup\Patch\Data\UpdateBmltoPayLater for module Magento_Paypal. Original exception message: Notice: Undefined offset: 1 in vendor/magento/module-paypal/Setup/Patch/Data/UpdateBmltoPayLater.php on line 138
When I checked the code, I found out we didn't check whether the value is exploadable in some scenarios like this
path => payment/paypal_express_bml/active , value => 0
and it's throwing the error in this line
$page = $settingParts[0]; $setting = $settingParts[1];
Expected result (*)
While Setup:upgrade it should work fine
Actual result (*)
Module 'Magento_Paypal': Unable to apply data patch Magento\Paypal\Setup\Patch\Data\UpdateBmltoPayLater for module Magento_Paypal. Original exception message: Notice: Undefined offset: 1 in vendor/magento/module-paypal/Setup/Patch/Data/UpdateBmltoPayLater.php on line 138
Fix for this :
Add if(strpos($setting, '_') == false) { continue }
foreach ($bmlSettings as $bmlPath => $bmlValue) { $setting = str_replace(self::BMLPATH, '', $bmlPath); if(strpos($setting, '_') == false) { continue; }
Metadata
Metadata
Assignees
Labels
Type
Projects
Status