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 Online

Official support hours:
Monday To Friday
From 09:00 To 17:00 Europe/London (BST)
  Tuesday, 20 April 2021
  7 Replies
  1.6K Visits
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
more than a month ago
·
#107531
This is working in my tests.

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

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

more than a month ago
·
#107535
The form is only in admin, not in frontend.
more than a month ago
·
#107536
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
more than a month ago
·
#107542
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
more than a month ago
·
#107548

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

more than a month ago
·
#107561
Works like a charm. :)

Thank you very much

Pavel
more than a month ago
·
#107759
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.
  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!