0

After updating Magento 2.1 to Magento 2.2 I get the following error when saving a client.

enter image description here

I have seen that in the customer_eav_attribute table the data has not been updated correctly to the new version.

For exemple, I have:

a:2:{s:15:"max_text_length";i:255;s:15:"min_text_length";i:1;}

And in version 2.2 it is necessary to have:

{"max_text_length":255,"min_text_length":1}

How to update this table? without reinstall Magento 2.2

1 Answer 1

1

you have to convert and update in your database. You can resolve it in file /vendor/magento/framework/Serialize/Serializer/Json.php by using this query:

    public function unserialize($string)
{
    $result = json_decode($string, true);
    if (json_last_error() !== JSON_ERROR_NONE) {
        $result = @$this->unserialize($string);
        if($result){
            return $result;
        }
        throw new \InvalidArgumentException("Unable to unserialize value. Error: " . json_last_error_msg());
    }
    return $result;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.