0

I am getting this error after I put a file upload button.When I click save I got this error

[2021-01-20 05:42:43] main.CRITICAL: Exception message: Notice: Array to string conversion in /var/www/html/M2_arbergtime.dk/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3105 Trace:

#1 Magento\Framework\DB\Adapter\Pdo\Mysql->prepareColumnValue(array('SCHEMA_NAME' => NULL, 'TABLE_NAME' => 'magefan_blog_pos...', 'COLUMN_NAME' => 'blog_header_imag...', 'COLUMN_POSITION' => 36, 'DATA_TYPE' => 'varchar', 'DEFAULT' => NULL, 'NULLABLE' => true, 'LENGTH' => 255, 'SCALE' => NULL, 'PRECISION' => NULL, 'UNSIGNED' => NULL, 'PRIMARY' => false, 'PRIMARY_POSITION' => NULL, 'IDENTITY' => false), array(array('name' => 'magento2.png', 'type' => 'image/png', 'tmp_name' => '/tmp/phpWBu1Sw', 'error' => 0, 'size' => 45718, 'file' => 'magento2.png', 'url' => 'http://127.0.0.1...', 'cookie' => array('name' => 'admin', 'value' => 'c0t2uv3r7c197mks...', 'lifetime' => 31536000, 'path' => '/M2_arbergtime.d...', 'domain' => '127.0.0.1'), 'previewType' => 'image', 'id' => 'bWFnZW50bzIucG5n')))

If i fill some value to image filed in table manually using phpmyadmin, than i git this error in edit page.

Uncaught TypeError: value.map is not a function at UiClass.setInitialValue (file-uploader.js:79)
0

Follow this post https://www.codextblog.com/magento-2/how-to-upload-image-or-file-in-custom-module-using-ui-component-in-magento-2/

In this post Step 8 should be add in your DataProvider.php file

1
  • added this line in etc/di.xml.... <preference for="Magefan\Blog\Ui\DataProvider\Post\Form\PostDataProvider" type="Kammalou\Blog\Ui\DataProvider\Post\Form\PostDataProvider" /> – Sanaullah Ahmad Jan 20 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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