Closed im-jc closed 6 years ago
Hi! I got the solution. To fix the issue following file needs to be override. \vendor\magento\framework\Serialize\Serializer\json.php
Extension can be created to do this. Extension is attached. Fixunserialization.zip
Issue is fixed by above solution.
@im-jc .. I'm not aware of any current issue, Magento 2.2.x/2.1.9 change from Serializer data to JSON which was address in https://github.com/magepal/magento2-custom-shipping-rate/releases/tag/1.3.0
So if you are using v1.4.0 you should not have any issue.
Hi! Thanks for response.
I am have upgraded magento version from 2.1.7 to 2.2.4.
In magento 2.1.7 i ahve installed 'magepal/magento2-customshippingrate' version 1.3.2 and it was working perfactly. But after upgrade it stated giving an error as posted in issue defination. So i have upgraded extension version to 1.4.0 and still got an error. It was fixed by overriding the file i have mentioned in solution.
Thank you for your time! :)
This seems to be a one-off issue caused by the sorting functionality.
Try disabling the Fixunserialization module and see if it still work. The issue should get fixed after the first shipping rate save and convert it to JSON
Yes it is working after disabling the Fixunserialization module. and yes it may be caused by the sorting functionality.
When I originally wrote this after Magento changing the way they storing values (JSON instead of serializing array) Serialize\Serializer\json.php was still there for backward compatibility but eventually removed got removed. So they why you ran into this issue.
Couple ways to fix this:
shipping_type
and recreate them (not ideal)json_encode(unserialize(shipping_type text here))
and copy the update to shipping_type row and save.I should have done something like this instead app/code/Magento/Braintree/Setup/UpgradeData.php
private function convertSerializedDataToJson(ModuleDataSetupInterface $setup)
{
$fieldDataConverter = $this->fieldDataConverterFactory->create(
\Magento\Framework\DB\DataConverter\SerializedToJson::class
);
$queryModifier = $this->queryModifierFactory->create(
'in',
[
'values' => [
'path' => ['payment/braintree/countrycreditcard']
]
]
);
$fieldDataConverter->convert(
$setup->getConnection(),
$setup->getTable('core_config_data'),
'config_id',
'value',
$queryModifier
);
}
Magento version #: 2.2.4
Edition (EE, CE, OS, etc): CE
Expected behavior: Extension should work properly and should not give error when i go to MAGENTO ADMIN -> STORES -> CONFIGURATION ->SALES -> SHIPPING METHODS
Actual behavior: It gives following error when i go to MAGENTO ADMIN -> STORES -> CONFIGURATION ->SALES -> SHIPPING METHODS
https://prnt.sc/jowf9p
Steps to reproduce:
Preconditions
Magento 2.2.4 PHP Version 7.0.28 MySQL 5.0.12