0

enter image description here

1 exception(s): Exception #0 (InvalidArgumentException): Unable to unserialize value when i add new customer and open existing customer In Admin side, Error is mention in above screenshot.

1
  • which magento version you are using? Mar 6, 2020 at 14:16

1 Answer 1

0

Open the this file :- /vendor/magento/framework/Serialize/Serializer/Json.php

Find:

public function unserialize($string)
{
    $result = json_decode($string, true);
    if (json_last_error() !== JSON_ERROR_NONE) {
        throw new \InvalidArgumentException('Unable to unserialize value.');
    }
    return $result;
}

replace by:

public function unserialize($string)
{
    $result = json_decode($string, true);
    if (json_last_error() !== JSON_ERROR_NONE) {
        if(false !== @unserialize($string)){
            return unserialize($string);
        }
        throw new \InvalidArgumentException('Unable to unserialize value.');
    }
    return $result;
}

And run the php bin/magento c:f

And refer this links :-

Magento 2.2: Unable to unserialize value?

Your Answer

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

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