TinyMCE 4 / Joomla 3.2 Multiple editor issue

  • Posts: 114
  • Thank you received: 14
10 years 2 months ago #142863

I have a custom field that uses a WYSIWYG editor so when creating or editing a product from the front end there are two editor windows shown on the page.

What I have found is that when the product is saved, the editors contents are not saved. All other fields are saved okay.

I have tried a test - changing the WYSIWYG field to a text field and everything then works okay.

The error I get is as follows:

TypeError: l is not a constructor tinymce.min.js (line 8)

Hopefully you should be able to reproduce this on your local box, if not and you want access to my site, just let me know.

I've temporarily disabled the WYSIWYG for the custom field but would like to get a fix.

I'm not 100% sure it worked perfectly with the previous version of tinymce. whilst the content was saved I seem to remember that line breaks were not preserved in the custom field , perhaps this is relevant?

TIA

DM

Please Log in or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 2 months ago #142866

Hi,

Can you please indicate your HikaShop and HikaMarket version number ?

Thanks


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 114
  • Thank you received: 14
10 years 2 months ago #142868

Ooops Sorry

HikaShop Business: 2.2.3
HikaMarket Multivendor: 1.3.2

Please Log in or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 2 months ago #142887

Hi,

I was able to reproduce the problem and I saw that the bug is not only an HikaMarket bug, it also happens in HikaShop backend.
The problem is that TinyMCE is initialized two times and Joomla 3.2 does not handle that the editor has been already initialized.
The TinyMCE 4 library does not handle the multiple initialization...
So I want to say that's more a Joomla bug than an HikaShop bug.. But, that's not the problem here.

We can fix it by editing the file "administrator/components/com_hikashop/helper/editor.php".
You have to replace

	var $id = 'jform_articletext';
	static $cpt = 0;
By
	var $id = 'jform_articletext';
	static $cpt = 0;
	static $initialized = array();
And also replace:
		$this->myEditor->initialise();
By
		if(!HIKASHOP_J30 || empty(self::$initialized[$this->editor]))
			$this->myEditor->initialise();
		self::$initialized[$this->editor] = true;
And it will fix the problem in HikaShop backend and in HikaMarket front-end, while editing a product or a category with a WYSIWIG custom field.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: DeeEmm

Please Log in or Create an account to join the conversation.

  • Posts: 114
  • Thank you received: 14
10 years 2 months ago #142918

Thanks for the super fast response Jerome.

Will give it a try and report back.

Please Log in or Create an account to join the conversation.

  • Posts: 114
  • Thank you received: 14
10 years 2 months ago #142920

Confirmed. Works as expected.

I concur with what you say about it being a TinyMCE4 library issue. I do not remember seeing this issue with the previous version of Tiny MCE.

Once again. Thanks!

:D

The following user(s) said Thank You: Jerome

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.068 seconds
Powered by Kunena Forum