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
- Forum
- JCE Editor
- Audio (mp3 file) in Custom Field not converted to audio tag
Hi Ryan,
First of all, I'm using :
- JCE Pro 2.9.33
- Joomla 3.10.11
- PHP 8.0.27
I have a weird issue on a freshly created custom field : if I upload/set field value as a mp3 file, a link is created instead of the "audio" tag.
You will find attached my current configuration : custom field details and Plugin Configuration (plg_fields_mediajce)
I do not know if this is a bug or a misconfiguration.
I notice 2 weird things :
1. The "Media Type" in Plugin COnfiguration does not provide any input to set default value (like Class or Description)
2. The "media_supported" field in the plugin always returns an array with ('img', 'a')
I can manage to fix the display by making an override of the file "mediajce.php" (html/plg_fields_mediajce/mediajce.php) in my template, by simply doing this (line 33 of the file), but I pretty sure that this is not the good way
Before my fix, the value of $data->media_supported is array('img', 'a')
After my fix, the value of $data->media_supported is array('img', 'video', 'audio', 'iframe', 'a')
And so the link is replaced with an "audio" tag
Can you help me ?
Thank you.
Regards,
Teddy
First of all, I'm using :
- JCE Pro 2.9.33
- Joomla 3.10.11
- PHP 8.0.27
I have a weird issue on a freshly created custom field : if I upload/set field value as a mp3 file, a link is created instead of the "audio" tag.
You will find attached my current configuration : custom field details and Plugin Configuration (plg_fields_mediajce)
I do not know if this is a bug or a misconfiguration.
I notice 2 weird things :
1. The "Media Type" in Plugin COnfiguration does not provide any input to set default value (like Class or Description)
2. The "media_supported" field in the plugin always returns an array with ('img', 'a')
I can manage to fix the display by making an override of the file "mediajce.php" (html/plg_fields_mediajce/mediajce.php) in my template, by simply doing this (line 33 of the file), but I pretty sure that this is not the good way

foreach($field->value as $key => $value) {
if (empty($value)) {
continue;
}
// Override : do not override media_supported value
if ($key != 'media_supported') {
$data[$key] = $value;
}
}
Before my fix, the value of $data->media_supported is array('img', 'a')
After my fix, the value of $data->media_supported is array('img', 'video', 'audio', 'iframe', 'a')
And so the link is replaced with an "audio" tag
Can you help me ?
Thank you.
Regards,
Teddy
I have a weird issue on a freshly created custom field : if I upload/set field value as a mp3 file, a link is created instead of the "audio" tag.
You will find attached my current configuration : custom field details and Plugin Configuration (plg_fields_mediajce)
I do not know if this is a bug or a misconfiguration.
This is the expected behaviour. The JCE Media Field does not yet support generating tags other than <img> and <a>, but this will change in the next update, as some of the code is already in place, as you have discovered.
If you override works, then use it, and you can remove it when support for additional tags is added.
Just because you're not paranoid doesn't mean everybody isn't out to get you.
I have a weird issue on a freshly created custom field : if I upload/set field value as a mp3 file, a link is created instead of the "audio" tag.
You will find attached my current configuration : custom field details and Plugin Configuration (plg_fields_mediajce)
I do not know if this is a bug or a misconfiguration.
This is the expected behaviour. The JCE Media Field does not yet support generating tags other than <img> and <a>, but this will change in the next update, as some of the code is already in place, as you have discovered.
If you override works, then use it, and you can remove it when support for additional tags is added.
Just because you're not paranoid doesn't mean everybody isn't out to get you.
This is the expected behaviour. The JCE Media Field does not yet support generating tags other than <img> and <a>, but this will change in the next update, as some of the code is already in place, as you have discovered.
Oh okay, that's why !
I will put a sticky note on my computer (yes, the good old way) to take a look on each future release of JCE to remove my override when the feature will be fully deployed

Thank you !
- Page :
- 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!