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)
asked Jan 20, 2021 at 6:15

1 Answer 1

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

answered Jan 20, 2021 at 7:32
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" /> Commented Jan 20, 2021 at 11:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.