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.

#112891 Audio (mp3 file) in Custom Field not converted to audio tag

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 GFCOM on Tuesday, 24 January 2023 16:39 GMT

GFCOM
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 :)

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

Attachments

Ryan
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 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.

Ryan Demmer

Lead Developer / CEO / CTO

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

GFCOM
[quotePost id="112894"]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.[/quotePost]

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 !