?
avatar Bakual
Bakual
26 Sep 2017

Steps to reproduce the issue

Try to use the ARS button in TinyMCE.

Expected result

I cna insert an ARS item

Actual result

Nothing happens

Additional comments

I get a console error:
ars
According to @nikosdion this is caused by a backward incompatible API break in the editor. See akeeba/release-system#126 (comment) for his explanation.

avatar Bakual Bakual - open - 26 Sep 2017
avatar joomla-cms-bot joomla-cms-bot - change - 26 Sep 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Sep 2017
avatar Bakual Bakual - change - 26 Sep 2017
Category JavaScript
avatar dgt41
dgt41 - comment - 26 Sep 2017

@Bakual is the form that contains the editor field rendered through jform?

avatar nikosdion
nikosdion - comment - 26 Sep 2017

I have only tried and succeeded to reproduce the issue with com_content (which uses JForm). However, how you display the editor should not break the API used by editor-xtd plugins to insert raw content into it.

avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Sep 2017
Status New Discussion
avatar Bakual
Bakual - comment - 26 Sep 2017

@dgt41 Tested with an article (com_content) as well as a category description in Akeeba Release System (com_ars). It's the same in both.

avatar dgt41
dgt41 - comment - 26 Sep 2017
avatar Bakual
Bakual - comment - 26 Sep 2017

Didn't work for me, but not sure if I did it right. JS is all magic to me. ?

avatar dgt41
dgt41 - comment - 26 Sep 2017

you still need to compress that file or use debug mode

avatar dgt41
dgt41 - comment - 27 Sep 2017

It turns out that it wasn't the core in this case
screen shot 2017-09-27 at 10 03 10

The editor variable that is passed to the function has way too many quotes, so in arslink.php (the xtd-button) the js part should be:

		$js = <<<JS


;// This comment is intentionally put here to prevent badly written plugins from causing a Javascript error
// due to missing trailing semicolon and/or newline in their code.
		function arsSelectItem(id, title) {
			var tag = '<a href='+'\"index.php?option=com_ars&amp;view=Item&amp;id='+id+'\">'+title+'</a>';
			jInsertEditorText(tag, '$name');
			jModalClose();
		};

JS;
avatar nikosdion
nikosdion - comment - 27 Sep 2017

Why had this code been working ever since Joomla! 1.5.15 without a problem? Or why did JCE never had an issue with it? You can see the version history in https://github.com/akeeba/release-system/commits/development/plugins/editors-xtd/arslink/arslink.php The code is untouched since 2012. In fact it's untouched for much longer, I just didn't care enough to import older SVN history to Git :)

avatar dgt41
dgt41 - comment - 27 Sep 2017

@nikosdion you used to have the javascript wrapped in double quotes till bda0d61afa7ee66a8c707b675450f74fe51bdc4b then you switched to <<<JS but you forgot to take out the extra unneeded double quote an the dots from that variable. Why does this work with other editors? I have no clue, but honestly I find it extremely weird that this line actually resolves correctly the id in any js script

avatar zero-24
zero-24 - comment - 27 Sep 2017

Closing as a vendor Problem.. thanks.

avatar zero-24 zero-24 - close - 27 Sep 2017
avatar zero-24 zero-24 - change - 27 Sep 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-09-27 17:41:42
Closed_By zero-24

Add a Comment

Login with GitHub to post a comment