? ? Pending

User tests: Successful: Unsuccessful:

avatar Denitz
Denitz
6 Jan 2022

Pull Request for Issue #36571 .

Summary of Changes

Joomla TimyMCE editor instances should be identified by full-featured ID but not by JForm field name attribute, otherwise fields with the same name use the single editor instance.

Joomla 4 is also affected, not sure if this patch will go into 4.0-dev, somebody please advise.

Testing Instructions

If a form has multiple editor fields with the same name but within different groups, all XTD button actions are applied in first editor only.

I.e. in item has top-level field <field name="description" type="editor"... + a field with the same name but inside the another group like <fields name="params"> <field name="description" type="editor"...

If you click any XTD buttons in the editor field of params group, all actions are actually applied in the first field.
I.e. Readmore is inserted in the first field etc.

Test:

Edit admin article.xml form of com_content and add these code after <fieldset name="basic" ... line:

<field
	name="articletext"
	type="editor"
	label="COM_CONTENT_FIELD_ARTICLETEXT_LABEL"
	description="COM_CONTENT_FIELD_ARTICLETEXT_DESC"
	filter="JComponentHelper::filterText"
	buttons="true"
	/>

Now we have two fields with the name articletext, the first one is original article text in Content tab, the second one is displayed in Options tab and has the field group attribs, these are two different fields even with the same name attribute.

Try to use any buttons in this second field, see that actually all actions are applied in the main editor field displayed in Content tab.

Actual result BEFORE applying this Pull Request

Button actions are executed on first field only.

Expected result AFTER applying this Pull Request

Button actions should be executed separately for each editor instance.

Documentation Changes Required

No.

31e7244 6 Jan 2022 avatar Denitz fix
avatar Denitz Denitz - open - 6 Jan 2022
avatar Denitz Denitz - change - 6 Jan 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Jan 2022
Category JavaScript External Library Front End Plugins
avatar Denitz Denitz - change - 6 Jan 2022
Title
TinyMCE editor buttons work with single field instance only
[3.10] TinyMCE editor buttons work with single field instance only
avatar Denitz Denitz - edited - 6 Jan 2022
avatar Fedik
Fedik - comment - 7 Jan 2022

Nope, sorry, it not allowed.
Your changes will break existing behavior, and most likely the editor in subform.

The idea that each editor with the same name share the same options (example in subform), also this options can be overriden by "name" in a plugin.

The issue is valid (and already reported somewhere), but the fix is not :)
Currently I have no idea how it can be fixed with existing "editors-xtd" api.
Try to use different names for each editor.

avatar zero-24
zero-24 - comment - 30 Apr 2022

Will close this PR here now based on the comment by @Fedik

avatar zero-24 zero-24 - close - 30 Apr 2022
avatar zero-24 zero-24 - change - 30 Apr 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-04-30 07:00:08
Closed_By zero-24
Labels Added: ? ?

Add a Comment

Login with GitHub to post a comment