You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#107520 Mediatype files not working anymore

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by JanM on Thursday, 06 May 2021 17:53 BST

n3t
Hello, I am using MediaJCE field in my custom form as follows:

<field name="filename" type="mediajce" mediatype="files" label="Choose file" />
This was functional some times ago, however now, in version 2.9.5 (not sure since which version this happened), this will open just images browser. I I check the generated code data url seems to be generated correctly with mediatype=files

data-url="index.php?option=com_jce&task=plugin.display&plugin=browser&standalone=1&client=1&element=jform_n3tfields__atachments__atachments0__filename&mediatype=files&context=22&fieldid={field-media-id}&ismoo=0&folder=some-folder"
However if I check network panel in chrome, the real URL called is with mediatype=images

index.php?option=com_jce&task=plugin.display&plugin=browser&standalone=1&client=1&element=jform_n3tfields__atachments__atachments0__filename&converted=1&mediatype=images&context=10029
Is there anything I need to change in my XML, or is this a bug? thank you in advance Pavel

Ryan
This is working in my tests.

Does this happen in the admin as well as the front-end?

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

n3t
The form is only in admin, not in frontend.

n3t
Hi Ryan, I tried to prepare some example for you, and seems I found reason - the field is used within subform like this

    <fieldset name="attachments" label="Attachments">
      <field name="atachments" type="subform" multiple="true" layout="joomla.form.field.subform.repeatable-table" label="Attachments">
        <form>
          <field name="title" type="text" label="Title" />
          <field name="filename" type="mediajce" mediatype="files" label="Filename" />
        </form>
      </field>
    </fieldset>
if used standalone

    <fieldset name="attachments" label="Attachments">
      <field name="test" type="mediajce" mediatype="files" label="Test" />
    </fieldset>
It works fine, but in subform it is not working correctly. Pavel

n3t
Hi Ryan, I made further investigation, and the issue was introduced in 2.9.4. Specifically in JS file /plugins/system/jce/js/media.js. If I copy this file from 2.9.3 over 2.9.5, selection works properly. There is new function introduced in this file, "updateMediaUrl" targeting subforms. In my case, it changes working data-uri

index.php?option=com_jce&task=plugin.display&plugin=browser&standalone=1&294969581b23b067c08b297f015b88ce=1&client=1&element=jform_n3tfields__atachments__atachments0__filename&mediatype=files&context=22&fieldid={field-media-id}&ismoo=0&folder=sici-stroje/emily
with simplified one

index.php?option=com_jce&task=mediafield.display&fieldid=jform_n3tfields__atachments__atachments0__filename
This causes parameter mediatype to diseappear, so only images are displayed. Pavel

Ryan
Please try JCE Pro 2.9.6 RC - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

n3t
Works like a charm. 🙂

Thank you very much

Pavel

JanM
I still have this issue, in the network inspector I see that the 'files' (nor media) is not transferred correctly to the mediatype parameter. Instead I see mediatype=undefined in the request that gets the files from a certain directory. I use 2.9.6 pro and cleared browser cache (to get the right media.js which seems to be the culprit).

Edit: I installed 2.9.7 beta 7 and it works now.