- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2020
08:32 PM
06-04-2020
08:32 PM
Re: The problem for "There has been an error processing your request" on Magento2
Correct your file
..vendor/magento/framework/Serialize/Serializer/Json.php
use Magento\Framework\Serialize\SerializerInterface; /** * Serialize data to JSON, unserialize JSON encoded data * * @api * @since 101.0.0 */ class Json implements SerializerInterface { /** * @inheritDoc * @since 101.0.0 */ public function serialize($data) { $result = json_encode(utf8ize($data)); if (false === $result) { throw new \InvalidArgumentException("Unable to serialize value2. Error: " . json_last_error_msg() ); } return $result; } /** * @inheritDoc * @since 101.0.0 */ public function unserialize($string) { $result = json_decode($string, true); if (json_last_error() !== JSON_ERROR_NONE) { throw new \InvalidArgumentException("Unable to unserialize value. Error: " . json_last_error_msg()); } return $result; } } function utf8ize( $mixed ) { if (is_array($mixed)) { foreach ($mixed as $key => $value) { $mixed[$key] = utf8ize($value); } } elseif (is_string($mixed)) { return mb_convert_encoding($mixed, "UTF-8", "UTF-8"); } return $mixed; }
Manish Mittal
https://www.manishmittal.com/
https://www.manishmittal.com/