Closed a-fellerer closed 3 years ago
I'm trying to upload a simple svg file in magento media manager in a static block, but it doesn't work after installing your extension.
File is: https://www.stainer-sunwood.com/wp-content/uploads/2021/04/Showroom-Beratung.svg
Please check your documentation! In the manual installation section you are speaking of "AdvancedBreadcrumbs".
After Composer Installation there are no files in app/code/
vendor/magestyapps/..
not in app/code/..
WebImages
, - and that is if you're installing the module manually under app/code/..
.di.xml
file needs to be fixed for it to all work again. This is how it can be done, - the string type value needs to be image/svg+xml
:
<?xml version="1.0"?>
<!--
/**
* Copyright © 2021 MagestyApps. All rights reserved.
* See LICENSE.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Cms\Model\Wysiwyg\Images\Storage">
<arguments>
<argument name="extensions" xsi:type="array">
<item name="allowed" xsi:type="array">
<item name="svg" xsi:type="string">image/svg+xml</item>
</item>
<item name="image_allowed" xsi:type="array">
<item name="svg" xsi:type="string">image/svg+xml</item>
</item>
</argument>
</arguments>
</type>
<virtualType name="Magento\Catalog\CategoryImageUpload" type="Magento\Catalog\Model\ImageUploader">
<arguments>
<argument name="allowedExtensions" xsi:type="array">
<item name="svg" xsi:type="string">image/svg+xml</item>
</argument>
<argument name="allowedMimeTypes" xsi:type="array">
<item name="svg" xsi:type="string">image/svg+xml</item>
</argument>
</arguments>
</virtualType>
<type name="Magento\MediaStorage\Model\File\Validator\NotProtectedExtension">
<plugin name="allow-svg" type="MagestyApps\WebImages\Plugin\File\Validator\NotProtectedExtensionPlugin" />
</type>
<type name="Magento\Cms\Model\Wysiwyg\Images\Storage">
<plugin name="allow-svg" type="MagestyApps\WebImages\Plugin\Wysiwyg\Images\StoragePlugin" />
</type>
<type name="Magento\Cms\Controller\Adminhtml\Wysiwyg\Images\Thumbnail">
<plugin name="allow-svg" type="MagestyApps\WebImages\Plugin\Controller\Adminhtml\Wysiwyg\Images\ThumbnailPlugin" />
</type>
<type name="Magento\Cms\Controller\Adminhtml\Wysiwyg\Directive">
<plugin name="allow-svg" type="MagestyApps\WebImages\Plugin\Controller\Adminhtml\Wysiwyg\DirectivePlugin" />
</type>
<type name="Magento\Theme\Model\Design\Backend\Logo">
<plugin name="allow-svg" type="MagestyApps\WebImages\Plugin\Design\Backend\ImagePlugin" />
</type>
<type name="Magento\Theme\Model\Design\Backend\Favicon">
<plugin name="allow-svg" type="MagestyApps\WebImages\Plugin\Design\Backend\ImagePlugin" />
</type>
<type name="Magento\Theme\Model\Design\Backend\Image">
<plugin name="allow-svg" type="MagestyApps\WebImages\Plugin\Design\Backend\ImagePlugin" />
</type>
</config>
Works now!
@Chatcloud , @MagestyApps
Works now!
here is the pull request for the fix ready for composer thanks! https://github.com/MagestyApps/module-web-images/pull/2
seems not work with 2.4, with above fix on di.xml
seems not work with 2.4, with above fix on di.xml
![]()
Seems like it starts to work again every time you flush caches, var/generation & view_preprocessed are cleared etc.. hmmm odd, that's with or without the changes i made on 2.4.2. Either way its still solved even without the pull request.
Thanks.
The issue have been fixed in version 1.0.2. Please, try upgrading the extension version. And please let us know if you're still facing the issue after the upgrade.
I'm trying to upload a simple svg file in magento media manager in a static block, but it doesn't work after installing your extension.
File is: https://www.stainer-sunwood.com/wp-content/uploads/2021/04/Showroom-Beratung.svg
Please check your documentation! In the manual installation section you are speaking of "AdvancedBreadcrumbs".
After Composer Installation there are no files in app/code/