Success

User tests: Successful: Unsuccessful:

avatar radiant-tech
radiant-tech
21 Feb 2014

In JFormFieldEditor, $editorType reads $element['editor'] instead of $element['editorType']

For BC, added a fallback to use 'editor' if 'editorType' is not provided as an attribute.

Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33257

avatar radiant-tech radiant-tech - open - 21 Feb 2014
avatar Bakual
Bakual - comment - 21 Feb 2014

Do you know when this got changed to editorType? Because the doc (http://docs.joomla.org/Editor_form_field_type) says to use editor. So I'd say the code checking for editorType is wrong and editor would be correct (as it used to be).
Or is there a reason to change the attribute name?

avatar radiant-tech
radiant-tech - comment - 21 Feb 2014

If you look in the history, it was introduced 5 months ago as part of GSOC. I think it is just oversight to not have included this type of correction. I plan to update the Joomla Doc for the field if/when this is merged.

avatar radiant-tech
radiant-tech - comment - 21 Feb 2014

Never mind ... I see now I was looking at this from the wrong perspective. $editorType was simply created to hold the possible values of the editor attribute in XML. Closing here and on Tracker.

avatar radiant-tech radiant-tech - change - 21 Feb 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-02-21 19:42:18
avatar radiant-tech radiant-tech - close - 21 Feb 2014
avatar radiant-tech radiant-tech - close - 21 Feb 2014
avatar radiant-tech radiant-tech - head_ref_deleted - 21 Feb 2014
avatar compojoom
compojoom - comment - 22 Feb 2014

If it was simple created to hold possible values of the editor attribute in XML than it had to be left to:
/**

  • The editorType of the editor. *
  • @var array
  • @since 3.2 */ protected $editorType;

Why do we have this in __set:
case 'editorType':
// Can be in the form of: editor="desired|alternative".
$this->editorType = explode('|', trim((string) $value));
break;

if we can't actually use it? Am I missing something here?

avatar Bakual
Bakual - comment - 22 Feb 2014

@compojoom Imho it works just fine as it is, using the editor attribute (as stated in documentation). The case 'editorType' ... part is just not needed at all and should be removed.
It is taken care of on line https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/form/field/editor.php#L214 and https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/form/field/editor.php#L230

avatar compojoom
compojoom - comment - 22 Feb 2014

That is what I'm saying. It is working just fine with editor, so we should remove the case 'editorType' as it is just confusing.

When I was looking at the code and wanted to find out if there was a way to use an editorType I thought that I had to set an attribute 'editorType' in the xml... So, if it is not used, then it shouldn't be there.

avatar Bakual
Bakual - comment - 22 Feb 2014

That is what I'm saying. It is working just fine with editor, so we should remove the case 'editorType' as it is just confusing.

Agreed. Someone of you two want to do a PR for it?

Add a Comment

Login with GitHub to post a comment