3

enter image description here

Notice: Array to string conversion in /home/pacifi48/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 2999 Magento 2 Version 2.2.2

How to solve???

1
  • Have you find any solution regarding this issues ? Commented Apr 23, 2018 at 5:09

2 Answers 2

3

To solve please do modification in below paths

Path : vendor/magento/framework/DB/Adapter/Pdo/Mysql.php
Under --> public function prepareColumnValue(array $column, $value)

Replace old code:

 case 'longtext':
    $value  = (string)$value;
    if ($column['NULLABLE'] && $value == '') {
        $value = null;
    }
    break;

With new code:

case 'longtext':
    if(!is_array($value)) $value  = (string)$value;
    else $value = '';
    if ($column['NULLABLE'] && $value == '') {
        $value = null;
    }
    break;

same error came to me now it solved

3
  • Does your answer work or this snipboard.io/d9gYuj.jpg?
    – zus
    Commented Aug 16, 2020 at 8:31
  • 2
    You should not change core code, this will be replaced in future updates. There is an underlying issue here as to why you are not getting a string.
    – NetStorm
    Commented Aug 16, 2020 at 9:34
  • You should under not circumstances change core code as this will break your site sooner or later and you will have no idea what you did and where. Commented Oct 2, 2020 at 14:24
0

You have to treat the data as an array instead of an object. For example, you want to access the title of an article. If you treat the article as an object you will use getter like $article->getTitle. So, in this case, you have to access it by this way $article['title']

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.