Editor CustomField do not work anymore with JCE 2.9.12+

Started by sirius, September 10, 2021, 14:43:21 PM

Previous topic - Next topic

sirius

Hello,

when we upgrade to JCE 2.9.12+, our custom fields set to editor, do not show the editor anymore.

Ryan, owner of JCE, explained to me what is going on :

Quote from: Ryan DemmerThe issue is caused by some javascript in Virtuemart, which attempts to create a new editor instance, before all javascript (including JCE javascript) has loaded on the page, ie:

<script type="text/javascript">// Creates a new editor instance
    tinymce.execCommand("mceAddControl",true,"field-15-customfield_value")
</script>

Quote from: Ryan Demmer
This script is in administrator/components/com_virtuemart/models/customfields.php on line 788

The reason this happens with JCE Pro 2.9.12+ and not JCE Pro 2.9.11, is that the way the javascript is loaded in 2.9.12+ was changed for Joomla 4 compatability. Nevertheless, Virtuemart should not try an execute a javascript function until it is sure that javascript function has actually loaded!

Until Virtuemart fixes this (you might want to inform them of the issue), you will need to use JCE Pro 2.9.11

Thanks in advance
J3.10.12 | PHP 7.4.33 + APC + Opcode
VM Prod : 3.8.6 | VM Test : 4.4.0.11095

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

sirius

J3.10.12 | PHP 7.4.33 + APC + Opcode
VM Prod : 3.8.6 | VM Test : 4.4.0.11095


sirius

J3.10.12 | PHP 7.4.33 + APC + Opcode
VM Prod : 3.8.6 | VM Test : 4.4.0.11095

sirius

J3.10.12 | PHP 7.4.33 + APC + Opcode
VM Prod : 3.8.6 | VM Test : 4.4.0.11095

Rune Rasmussen

#6
And same issue on VirtueMart 4.0.2 10661 and Joomla 3.10.11  :'(
Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team

Jumbo!

Try this.

Open - administrator/components/com_virtuemart/models/customfields.php

Find the following codes between lines 859 to 860:

vmJsApi::addJScript('mceAddControl', '// Creates a new editor instance
tinymce.execCommand("mceAddControl",true,"field-' . $row . '-customfield_value")', true);


Replace the above by:

vmJsApi::addJScript('mceAddControl-' . $row, 'tinymce.execCommand("mceAddControl", true, "field-' . $row . '-customfield_value");', true, false, true);

This should resolve the issue.

Rune Rasmussen

Thanks Jumbo!

That works nicely. Lets hope it can get fixed in VM core some day too.
Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team


Milbo

Added, sorry guys, but I cannot fix anything. VirtueMart is a opensource project and relies on the work of people volunteers in the forum. Thank you Abhishek, added to the core.

Btw, I did not test if it works on j3 and j4.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Patrick, if you provide the code, I think anyone agrees that we add it.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Mike J

Quote from: Milbo on August 30, 2022, 23:42:16 PMI cannot fix anything. VirtueMart is a opensource project and relies on the work of people volunteers in the forum.

Hello Max,

Welcome back. I trust that you had a great time away.

Some hard-working volunteers on the forum have made some useful points about the decreased reputation and reliability of VM over the last 6-8 weeks.

I'm not sure how VM is set up. If you're the CEO, or chief programmer, coder or owner... But it appears that you're the face and future of VM (Certainly, when you're away, nothing happens).

... As it's open source, would you consider delegating and/or training up some of these guys, who really do have VMs best interests at heart, to help steer the ship next time you're away?

It would mean releasing some control... Handing over some keys... You may not want to do this, but I'll throw the idea out there not to be popular but because I believe actioned, this suggestion would greatly benefit all attached to the VM project.

TEAM = Together, Everyone, Achieves, More.

Again, it's great to have you back.
VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39

Jumbo!

Quote from: Milbo on August 30, 2022, 23:42:16 PM
Thank you Abhishek, added to the core.

Btw, I did not test if it works on j3 and j4.

I have tested it. It works fine both on Joomla 3 and Joomla 4.

Studio 42

Max, I've already posted bugs and fixes for the last few months and haven't heard back.
I don't waste time for nothing.