diff --git a/Setup/UpgradeData.php b/Setup/UpgradeData.php index 537faeb7..75395502 100644 --- a/Setup/UpgradeData.php +++ b/Setup/UpgradeData.php @@ -57,6 +57,11 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface if (version_compare($context->getVersion(), '2.0.1', '<')) { $this->convertSerializedDataToJson($setup); } + + // Hotfix to remove incorrectly stored LPM config key/values + if (version_compare($context->getVersion(), '4.0.1', '<')) { + $this->removeNullLpmAllowedMethods($setup); + } } /** @@ -90,4 +95,21 @@ private function convertSerializedDataToJson(ModuleDataSetupInterface $setup) $queryModifier ); } + + /** + * Hotfix to remove incorrectly stored config value for `payment/braintree_local_paymnet/allowed_methods` + * + * @param ModuleDataSetupInterface $setup + */ + private function removeNullLpmAllowedMethods(ModuleDataSetupInterface $setup) + { + $connection = $setup->getConnection(); + $connection->delete( + $setup->getTable('core_config_data'), + [ + '`path`=?' => 'payment/braintree_local_payment/allowed_methods', + '`value` IS NULL' + ] + ); + } } diff --git a/composer.json b/composer.json index 6c83beaa..7efb9abf 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "gene/module-braintree", "description": "Fork from the Magento Braintree 2.2.0 module by Gene Commerce for PayPal.", - "version": "4.0.0", + "version": "4.0.1", "type": "magento2-module", "license": "proprietary", "require": { diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index fb5e52c9..e33c8700 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -319,6 +319,7 @@ payment/braintree_local_payment/title + required-entry 1 @@ -330,8 +331,8 @@ valid for that method, regardless of the method being enabled here. Magento\Braintree\Model\Adminhtml\Source\LpmMethods - 1 payment/braintree_local_payment/allowed_methods + required-entry 1 diff --git a/etc/module.xml b/etc/module.xml index 775408ea..641312c1 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -6,7 +6,7 @@ */ --> - +