magento-2-admin-ui icon indicating copy to clipboard operation
magento-2-admin-ui copied to clipboard

Image upload

Open UpSage opened this issue 6 months ago • 2 comments

HIi,

So basically this button won't work and shows error when uploading an image.

May I know the correct settings?

Thank you

image

UpSage avatar Dec 22 '23 00:12 UpSage

Hello UpSage. Your URL here is incorrect. You need the actual URL of your controller that will save your image.

<uploaderConfig>
     <param xsi:type="string" name="url">pub/media/wysiwyg</param>
</uploaderConfig>

Look here for an example vendor/magento/module-catalog/view/adminhtml/ui_component/category_form.xml vendor/magento/module-catalog/Controller/Adminhtml/Category/Image/Upload.php.

<uploaderConfig>
      <param xsi:type="url" name="url" path="catalog/category_image/upload"/>
</uploaderConfig>

But this is not the only problem. After fixing the above issue, you will encounter the following magento core error https://github.com/magento/magento2/pull/38074. This issue is still open, but you can grab the code here https://github.com/magento/magento2/pull/38074/files and use composer patches to apply this solution.

graschik avatar Dec 22 '23 08:12 graschik

Thank you @graschik.I will try this one once I'm done with my project.

UpSage avatar Jan 04 '24 11:01 UpSage