Giter Site home page Giter Site logo

magento-2-module-experius-wysiwygdownloads's Introduction

Mage2 Module Experius WysiwygDownloads

This module makes it possible to upload different filetypes inside the WYSIWYG-editor.

experius/module-wysiwygdownloads

Main Functionalities

The following filetypes are available by default and it is possible to add extra filetypes to the allowed filetypes in the configuration of the module (General > Content Management > WYSIWYG Options > Extra Allowed Filetypes):

  • Word (doc, docm, docx)
  • Excel (csv, xml, xls, xlsx)
  • PDF (pdf)
  • Compressed Folder (zip, tar)

Use the following instructions to upload a file and set a download link:


Additional Information

  1. Go to a WYSIWYG-editor (for example in the content of a CMS Page or a product textarea attribute)
  2. Select a part of the text which is used as a Download Link (it is also possible to add the Download Link to an Image)
  3. Click on the 'Insert/Edit Link'-button (under the textformat dropdown, do not use the 'Insert/Edit Image'-button)
  4. Click on the 'Browse'-icon behind the Link URL-inputfield
  5. Select the Folder in which you want to upload the Downloadable File (recommended is to create a new Downloads folder to store all the Downloadable Files)
  6. Click the 'Browse files'-button
  7. Select the File from your Documents and click on the 'Open/Insert'-button
  8. Select the Uploaded File
  9. Click on the 'Insert File'-button
  10. (The 'File Upload'-windows will automatically close)
  11. It is recommended to set the Target to 'Open Link in a New Window)
  12. Press on the 'Insert'-button in the 'Insert/Edit Link'-popup
  13. The part of the text which was selected is now a Download Link for the selected file

To Unlink the Downloadable File just set the cursor on the Download Link and Click on the 'Unlink'-button.


Add NGINX redirect if you use it as internal URL else where and use store_code in url

    if ( $request_uri ~ ^/(.+)/media/wysiwyg/PDF/(.*)(.pdf$|.PDF$) ) {
            rewrite ^/(.+)/media/wysiwyg/PDF/(.*)(.pdf$|.PDF$) /media/wysiwyg/PDF/$2$3;
    }

Important Issue in Magento < 2.2

Fix

This is an issue in Magento and is solved in 2.2.2 for more information see the following commit:

https://github.com/magento/magento2/commit/62378774f239c2019e39bdd353c8c6c674b54fb1

Issue

bildschirmfoto 2017-09-20 um 16 44 22 bildschirmfoto 2017-09-20 um 16 49 11

src is correct: <img src="http://domain.com/pub/media/wysiwyg/.thumbs/home/home-t-shirts.png?rand=1505918839" alt="home-t-shirts.png">

src is incorrect: <img src="http://domain.com/admin_111/cms/wysiwyg_images/thumbnail/file/aHRtbC1jaGVhdC1zaGVldC5wbmc-/key/08c5525fa3b16c91f2ad0f757282e78f6abf1f797e8c30628598f1b3824934d8/" alt="html-cheat-sheet.png">


Change log

Version 1.0.8 - Jan 19, 2018 | Lewis Voncken

  • [TASK] Updated README.md and CHANGE.log Added Important Issue in Magento < 2.2

Version 1.0.7 - Sep 4, 2017 | Lewis Voncken

  • [BUGFIX] Solved problem with Product Image upload => Notice: Undefined index: extension

Version 1.0.6 - June 12, 2017 | Derrick Heesbeen

  • [BUGFIX] make it compatible with the Experius FileManager

Version 1.0.5 - June. 7, 2017 | Lewis Voncken

  • [TASK] Updated README.md with nginx redirect for internal url with storecodes

Version 1.0.4 - May. 18, 2017 | Lewis Voncken

  • [BUGFIX] Solved error message Unsupported image format

Version 1.0.3 - Sep. 23, 2016 | Lewis Voncken

  • [TASK] Changed README
  • [TASK] Added Open Software License

Version 1.0.2 - Sep. 19, 2016 | Lewis Voncken

  • [TASK] Version update to 1.0.2 added configuration option to add more allowed filetypes beside the Default Extra Filetypes

Version 1.0.1 - Sep. 17, 2016 | Lewis Voncken

  • [TASK] Changed the logic so file extensions can be added in the configuration

Version 1.0.0 - Sep. 16, 2016 | Lewis Voncken

  • Initial Commit

magento-2-module-experius-wysiwygdownloads's People

Contributors

borisvankatwijk avatar experius-nl avatar genius-dev-pl avatar iriks-it avatar lewisvoncken avatar mzeis avatar oscarpas avatar userwiths avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magento-2-module-experius-wysiwygdownloads's Issues

Not working url

Thank you for the great module, but i have one problem with it.

Everything goes well but i have a problem with adding the link. When i add a link (first adding the file through the url button, then add file, then add url) i'll get the wrong url.

It seems like he sees the file as an image file. In your explanation you use a "NGINX redirect". Can you clarify what that is?
Maybe that's the problem.

How can I remove this module?

LogicException: Circular dependency: Magento\Framework\Logger\Monolog depends on Magento\Store\Model\Config\Processor\Fallback and vice versa.

I receive above error after installing from composer and have not been able to access my site.
Can you help me?

Not Working

I have installed this module and do as you said but it is not dispaly actual pdf file link to frontend cms-page/product detail page.

Also insert image button not working after install this module.

Facing the same problem https://github.com/experius/Magento-2-Module-Experius-WysiwygDownloads/issues/2

Thanks for writing a module . Its really helpful however i am experiencing the same problem as mentioned in this thread:

#2

Below is the html of editor:

PDF File uploads without any problem, but Its generating/pasting a link like below for PDF file. I am using insert/edit link in inline wysiwyg editor

http://discountpoolsdirect-magento.com/pooladmin/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvUERGL0JlbGl6ZV9Bc2FoaV81MmluX0JyYWNlZF9PdmFsMjAxMS5wZGYifX0,/key/403d9a69f6ea5c72e8474a5a9085ee5b4fe00020eb32583e7c808aa59284d965/"
please suggest.

Thanks
Vikas

PHP deprication error after upgrade to PHP 8.1

Hi everyone,

After upgrading to PHP 8 there is an error occurring for the image pagebuilder element if you choose "select from gallery".

The error appears by not displaying any of the gallery content (only the directory tree). Furthermore, you'll find the following log in your system.log:
Exception: Deprecated Functionality: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in vendor/experius/module-wysiwygdownloads/Helper/Settings.php on line 86 in /var/www/html/magento/vendor/magento/framework/App/ErrorHandler.php:62

Prerequisite is that you've NOT added any additional file types to: Config > General > Content Management > WYSIWYG Options > Extra Allowed Filetypes in the WYSIWYG-editor

Quick workaround would be also to just add any type to that configuration.

I'm on Magento 2.4.5

After installing When I clicked on General ->content Management I got following errror

After installation When I clicked on General ->content Management I got following error

Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: Experius\WysiwygDownloads\Block\Adminhtml\System\Config\Form\Field\Filetypes
Exception #1 (ReflectionException): Class Experius\WysiwygDownloads\Block\Adminhtml\System\Config\Form\Field\Filetypes does not exist

where is problem actually ? I put code in

app/code/experius/module-wysiwygdownloads

mp3 - not works

Please add
<item name="mp3" xsi:type="string">audio/mpeg</item>
in di.xml

Error in the plugin

Hello everyone,

Thank you very much for the great module.

We found a problem with the plugin (Experius\WysiwygDownloads\Plugin\Magento\MediaGalleryUi\Ui\Component\Listing\Columns\Url).

The class used ("use Experius\Core\Helper\Settings;") does not exist. A replacement with ("use Experius\WysiwygDownloads\Helper\Settings;") no longer generated an error during setup:di:compile.

Thank you very much and have a nice weekend
Adam

problem on loading image

Hello,
I have installed the module and it works correctly (magento 2.1.7)!!!
However, I found an error when I load images in the product page default section.
When I try to upload an image (of any extension) I receive this error:

Attention
We do not recognize or support this file extension type.

ps. If I disable the module the problem disappears

Thanks in advance
problem_load_image

Update:
I have investigated with firefox inspect element and i have found these 2 errors:
{"Error": "$ _ FILES array is empty", "error code": 0}
and
Notice: Undefined index: extension in /xxx/vendor/experius/module-wysiwygdownloads/Image/Adapter/Gd2.php on line 35

SVG upload issues

The issue

Uploading SVG generates an error. And after fixing the error, svg does not show in the list of files displayed.

The setup.

  • PHP 8.2
  • Magento 2.4.6
  • WYSIWYG editor
  • Running composer show experius/module-wysiwygdownloads returns versions : * 1.2.2 and source : [git] https://github.com/experius/Magento-2-Module-Experius-WysiwygDownloads.git b4be0ae90a11d353bf6110c33dcb3dbbc77945ed
  1. composer require experius/module-wysiwygdownloads
  2. Have the module installed, enabled and active.
  3. Rebuild with magento setup:upgrade; magento setup:di:compile; magento setup:static-content:deploy -f;
  4. Clear cache and reindex
  5. Log into admin panel.
  6. Go to Content -> Pages -> Create/New Page
  7. Click on Insert Image icon.
  8. Select an SVG
  9. Receive error filename.svg: Disallowed file type.

Details

Does not upload file at all.

It seems that Magento2 uses a config option found under general/file/protected_permissions found in file ./vendor/magento/module-media-storage/Model/File/Validator/NotProtectedExtension.php (link leads to magento repo), it has a method isValid that is called by ./vendor/magento/module-media-storage/Model/File/Uploader.php's checkAllowedExtension.

File does not show in the file selection window.

Now after fixing the above issue (did a simple insert into the core_config_data table). I uploaded the SVG image, saw it is inside the folder through the console, but could not select it in magento because it was not showing with the other files.
After a bit of searching I found this to be due to ./vendor/magento/module-media-gallery-integration/Plugin/SaveImageInformation.php's afterSave method which saves the record in the media_gallery_asset table.
More specifically the isApplicable was evaluted to false because of the following condition. Here imageExtensions has the formats described in here in addition to the magento's default values.

Product image is not uploading

I am using 2.1.3

when i try to upload image in product it gives this error

{"error":"Notice: Undefined index: extension in app/code/Experius/WysiwygDownloads/Image/Adapter/Gd2.php on line 35","errorcode":0}

After upgrading to 1.2.3 version, no renditions are generated in wysiwyg/media library

Using any media library (old or new) in Magento 2.4.6-p3 (and p4), if an image is uploaded using "Upload image / file", the renditions are not generated, so in the gallery a "image coming soon" placeholder is shown, but if you open the detail of the image, it is there, so it's loaded in the correct place.
Just missing renditions, making the media library unusable.
If I disable this module, images get their renditions immediately generated and shown in the media library list.

is_writable(): Argument #1 ($filename) must be of type string, null given in

[2024-03-15T09:26:26.043427+00:00] report.CRITICAL: TypeError: is_writable(): Argument #1 ($filename) must be of type string, null given in /app/bqztqkvnl2vqi/vendor/magento/framework/Image/Adapter/AbstractAdapter.php:690
Stack trace:
#0 /app/bqztqkvnl2vqi/vendor/magento/framework/Image/Adapter/AbstractAdapter.php(690): is_writable()
#1 /app/bqztqkvnl2vqi/app/code/Experius/WysiwygDownloads/Image/Adapter/Gd2.php(66): Magento\Framework\Image\Adapter\AbstractAdapter->_prepareDestination()
#2 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(58): Experius\WysiwygDownloads\Image\Adapter\Gd2->save()
#3 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(138): Experius\WysiwygDownloads\Image\Adapter\Gd2\Interceptor->___callParent()
#4 /app/bqztqkvnl2vqi/vendor/magento/module-remote-storage/Plugin/Image.php(160): Experius\WysiwygDownloads\Image\Adapter\Gd2\Interceptor->Magento\Framework\Interception{closure}()
#5 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(135): Magento\RemoteStorage\Plugin\Image->aroundSave()
#6 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(153): Experius\WysiwygDownloads\Image\Adapter\Gd2\Interceptor->Magento\Framework\Interception{closure}()
#7 /app/bqztqkvnl2vqi/generated/code/Experius/WysiwygDownloads/Image/Adapter/Gd2/Interceptor.php(32): Experius\WysiwygDownloads\Image\Adapter\Gd2\Interceptor->___callPlugins()
#8 /app/bqztqkvnl2vqi/vendor/magento/framework/Image.php(75): Experius\WysiwygDownloads\Image\Adapter\Gd2\Interceptor->save()
#9 /app/bqztqkvnl2vqi/vendor/amasty/blog-sys/Model/ImageProcessor.php(162): Magento\Framework\Image->save()
#10 /app/bqztqkvnl2vqi/vendor/amasty/blog-sys/Model/ResourceModel/Posts.php(385): Amasty\Blog\Model\ImageProcessor->processCategoryIcon()
#11 /app/bqztqkvnl2vqi/vendor/amasty/blog-sys/Model/ResourceModel/Posts.php(364): Amasty\Blog\Model\ResourceModel\Posts->saveImage()
#12 /app/bqztqkvnl2vqi/vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php(841): Amasty\Blog\Model\ResourceModel\Posts->_afterSave()
#13 /app/bqztqkvnl2vqi/vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php(402): Magento\Framework\Model\ResourceModel\Db\AbstractDb->processAfterSaves()
#14 /app/bqztqkvnl2vqi/vendor/amasty/blog-sys/Model/Repository/PostRepository.php(99): Magento\Framework\Model\ResourceModel\Db\AbstractDb->save()
#15 /app/bqztqkvnl2vqi/vendor/amasty/blog-sys/Controller/Adminhtml/Posts/Save.php(63): Amasty\Blog\Model\Repository\PostRepository->save()
#16 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(58): Amasty\Blog\Controller\Adminhtml\Posts\Save->execute()
#17 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(138): Amasty\Blog\Controller\Adminhtml\Posts\Save\Interceptor->___callParent()
#18 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(153): Amasty\Blog\Controller\Adminhtml\Posts\Save\Interceptor->Magento\Framework\Interception{closure}()
#19 /app/bqztqkvnl2vqi/generated/code/Amasty/Blog/Controller/Adminhtml/Posts/Save/Interceptor.php(23): Amasty\Blog\Controller\Adminhtml\Posts\Save\Interceptor->___callPlugins()
#20 /app/bqztqkvnl2vqi/vendor/magento/framework/App/Action/Action.php(111): Amasty\Blog\Controller\Adminhtml\Posts\Save\Interceptor->execute()
#21 /app/bqztqkvnl2vqi/vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch()
#22 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch()
#23 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(138): Amasty\Blog\Controller\Adminhtml\Posts\Save\Interceptor->___callParent()
#24 /app/bqztqkvnl2vqi/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(145): Amasty\Blog\Controller\Adminhtml\Posts\Save\Interceptor->Magento\Framework\Interception{closure}()
#25 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch()
#26 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(153): Amasty\Blog\Controller\Adminhtml\Posts\Save\Interceptor->Magento\Framework\Interception{closure}()
#27 /app/bqztqkvnl2vqi/generated/code/Amasty/Blog/Controller/Adminhtml/Posts/Save/Interceptor.php(32): Amasty\Blog\Controller\Adminhtml\Posts\Save\Interceptor->___callPlugins()
#28 /app/bqztqkvnl2vqi/vendor/magento/framework/App/FrontController.php(245): Amasty\Blog\Controller\Adminhtml\Posts\Save\Interceptor->dispatch()
#29 /app/bqztqkvnl2vqi/vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#30 /app/bqztqkvnl2vqi/vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()
#31 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#32 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#33 /app/bqztqkvnl2vqi/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()
#34 /app/bqztqkvnl2vqi/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#35 /app/bqztqkvnl2vqi/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#36 /app/bqztqkvnl2vqi/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()
#37 /app/bqztqkvnl2vqi/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#38 {main} [] []

not showing thumbs in admin after image upload

Thank you for the great module, but i have one problem with it.

bildschirmfoto 2017-09-20 um 16 44 22
bildschirmfoto 2017-09-20 um 16 49 11

src is correct:
<img src="http://domain.com/pub/media/wysiwyg/.thumbs/home/home-t-shirts.png?rand=1505918839" alt="home-t-shirts.png">

src is incorrect:
<img src="http://domain.com/admin_111/cms/wysiwyg_images/thumbnail/file/aHRtbC1jaGVhdC1zaGVldC5wbmc-/key/08c5525fa3b16c91f2ad0f757282e78f6abf1f797e8c30628598f1b3824934d8/" alt="html-cheat-sheet.png">

product image upload

Na installatie en na het toevoegen van allow file types in de backend configuratie kan ik nog steeds geen enkele product image meer uploaden. De melding:
"We don't recognize or support this file extension type."

Can't get svg extension to work

I have added the values below to the adminhtml/di.xml, however I can not upload a svg file

<item name="allowed" xsi:type="array">
    <item name="svg" xsi:type="string">image/svg</item> 
</item>

<item name="image_allowed" xsi:type="array">
    <item name="svg" xsi:type="string">image/svg</item>
</item>

<item name="media_allowed" xsi:type="array">
    <item name="svg" xsi:type="string">image/svg</item>
</item>

Media manager doesn't show pdfs in 2.4.6

The new media management of Magento doesn't show pdfs. They're uploaded successfully, however they're not available in the media management to actually use them.

image

Media Library doesn't work when module active

So I installed the module and tried to use it.

When on a page and create a link and try to browse the Media Library the slide out is blank, and on the product page in the background I get the following error:

"A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later."

Running:
Magento 2.2.4
PHP 7
Apache 2

When I turn the module off everything works fine again.

How to Install on Magento 2.1.0

Hi there,

How to install this on Magento 2.1.0, i'm new in magento so if you could kindly give me step by step installation would be of good help.

Many thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.