J4 Issue PR-4.0-dev


User tests: Successful: Unsuccessful:

avatar hardik-codes
29 Mar 2019

Pull Request for Issue #19954
Media field does not allow to select files that are not images (PDF, ...)

Summary of Changes

Changes in plugins/fields/media/tmpl/media.php

Testing Instructions

Code Inspection

93f5b2a 29 Mar 2019 avatar hardik-codes Fix
avatar hardik-codes hardik-codes - open - 29 Mar 2019
avatar hardik-codes hardik-codes - change - 29 Mar 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 Mar 2019
Category Front End Plugins
avatar hardik-codes
hardik-codes - comment - 29 Mar 2019

@martyharty please test

avatar brianteeman
brianteeman - comment - 29 Mar 2019
avatar martyharty
martyharty - comment - 30 Mar 2019

Code works as expected on Joomla! 4.0.0-alpha8-dev: https://gridx.joomla.com/
In my opinion media types refer to file, image, audio, video as well as the next practice.

Improvement for future reference in plugins/fields/media/params/media.xml
20: JNO could be extended for more clarity:


Also other extensions like .doc might be added with:
if((substr($path, -4) == '.pdf') || (substr($path, -4) == '.doc'))
(uploading works from backend).


avatar hardik-codes hardik-codes - change - 31 Mar 2019
The description was changed
avatar hardik-codes hardik-codes - edited - 31 Mar 2019
avatar stutteringp0et
stutteringp0et - comment - 23 Apr 2019

I think the field type you're looking for to select non-images is: filelist


Within its options, one can filter by extension using regex - PDF, for example.

Add a Comment

Login with GitHub to post a comment