? Success

User tests: Successful: Unsuccessful:

avatar phproberto
phproberto
2 Nov 2015

#Index

  1. Improvements
    1.1. [imp] Convert JFormField::getInputLayoutData() into JFormField::getLayoutData()
    1.2. [imp] Add a base JFormField::getInput() method that can be inherited
    1.3. [imp] Allow to debug fields rendering
    1.4. [imp] Add support to specify the rendering layout in form's XML
  2. Additional testing information

1. Improvements

1.1. Convert JFormField::getInputLayoutData() into JFormField::getLayoutData()

I think the purpose of that method is that we had different methods to get layout data for the label and for the input of the fields but we only need a single getLayoutData() that can be passed to getLabel() and getInput(). Sometimes frontenders face an issue that involves rendering the label of the field in the field itself. And that's easier if you have everywhere the information required to render anything.

1.2. Add a base JFormField::getInput() method that can be inherited

Now all the fields that extend JFormField can inherit the getInput() method and mostly remove it. Actually that should be our priority because getInput() method is the bigger headache for frontenders now. Removing it clearly sets a line betwee what backenders need to do (populate the required data in the getLayoutData() method) and frontenders need to do (style that data in the layouts).

Note that currently all the fields override the getInput() method so at current state only direct childs of JFormField will inherit getInput(). A good example is JFormFieldCheckboxes that inhertis JFormFieldList. So until the getInput() mehotd of JFormFieldList is not moved to a layout JFormFieldCheckboxes has to keep his own override.

1.3. Allow to debug fields rendering

Now fields that use the new JLayoutFile renderer will allow that developers enable/disable debug mode in the form XML just adding debug="true".

Example:

<field name="lineNumbers" type="radio"
       class="btn-group btn-group-yesno"
       debug="true"
       default="0"
       filter="options"
       description="PLG_CODEMIRROR_FIELD_LINENUMBERS_DESC"
       label="PLG_CODEMIRROR_FIELD_LINENUMBERS_LABEL"
    >
    <option value="1">JON</option>
    <option value="0">JOFF</option>
</field>

When the form is rendered it will show something like:

field-debug

1.4. Add support to specify the rendering layout in form's XML

Now fields also support that the same field can be rendered using different layouts just adding layout="mylibrary.field.name". That increases fields reusability because you can, for example, use a text field to add a currency value, an AJAX field, etc.

Example:

<field name="lineNumbers" type="radio"
       class="btn-group btn-group-yesno"
       default="0"
       layout="mylibrary.field.radio"
       filter="options"
       description="PLG_CODEMIRROR_FIELD_LINENUMBERS_DESC"
       label="PLG_CODEMIRROR_FIELD_LINENUMBERS_LABEL"
    >
    <option value="1">JON</option>
    <option value="0">JOFF</option>
</field>

3. Additional testing information

This PR changes internal behavior of fields. So:

  • Try to edit most common used forms.
  • Particularly check forms that involve type="radio" and type="checkboxes" fields because they have received most of the modifications.
avatar phproberto phproberto - open - 2 Nov 2015
avatar phproberto phproberto - change - 2 Nov 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Nov 2015
Labels Added: ?
avatar dgt41 dgt41 - test_item - 2 Nov 2015 - Tested successfully
avatar dgt41
dgt41 - comment - 2 Nov 2015

I have tested this item :white_check_mark: successfully on ff2f830

Core front end, back end, 3pd components all ok!
Updated the 3 fields PRs to get in-line with this

Thanks @phproberto


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8248.

avatar phproberto
phproberto - comment - 2 Nov 2015

@dgt41 note that tests fail :D I'll fix it in a couple of hours

avatar phproberto
phproberto - comment - 2 Nov 2015

I have removed the commit that removes the JLayout HTML comments from here. I will submit a new PR so we can merge it for v3.5

avatar phproberto
phproberto - comment - 2 Nov 2015
  • Now getInput throws an exception when there is not active layout. Thanks @wilsonge.
  • Now layout is processed in field setup and it can be accessed/modified with magic methods. Thanks @Fedik

Now let's try to get those tests working :P

avatar phproberto
phproberto - comment - 2 Nov 2015

Tests passed now :dancer:

avatar zero-24 zero-24 - change - 3 Nov 2015
Milestone Added:
avatar zero-24 zero-24 - change - 3 Nov 2015
Category Libraries
avatar joomla-cms-bot
joomla-cms-bot - comment - 3 Nov 2015

This PR has received new commits.

CC: @dgt41


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8248.

avatar phproberto
phproberto - comment - 3 Nov 2015

Ok. This is what I did:

  • JFormField will pass class & labelclass to layouts
  • To keep B/C in radio & checkboxes getLayoutData() methods I added the classes value for their layouts

I think this is the best we can do now.

avatar wilsonge
wilsonge - comment - 3 Nov 2015

If the layouts are new we can get away with it. Let me just check but I think they are new for 3.5 - if so then we can get away with it I guess

avatar dgt41
dgt41 - comment - 3 Nov 2015

Nice now I have to redo the other PRs ????

avatar wilsonge
wilsonge - comment - 3 Nov 2015

#4022 we merged this october 1st. so no b/c issues with moving the layouts - my bad!

avatar phproberto
phproberto - comment - 3 Nov 2015

I'm moving layouts to layouts/joomla/form/field then. That doesn't affect you @dgt41 so let's get all together!

avatar phproberto
phproberto - comment - 4 Nov 2015

yes!

avatar joomla-cms-bot
joomla-cms-bot - comment - 4 Nov 2015

This PR has received new commits.

CC: @dgt41


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8248.

avatar phproberto
phproberto - comment - 4 Nov 2015

Is ready for new tests if travis gives the ok.

Being there testing the fields I noticed that codemirror fullScreenMod parameter was not aligned properly so I fixed it (remove 1 line). Just in case somebody see the XML modified.

Before:
before-codemirro

After:
after-codemirror

avatar zero-24 zero-24 - test_item - 4 Nov 2015 - Tested successfully
avatar zero-24
zero-24 - comment - 4 Nov 2015

I have tested this item :white_check_mark: successfully on 92225ca

Works good. I have tested this in combination with the other PRs by @dgt41 and can confirm that the radio and checkboxes (codemirror) in Backend still works. Thanks


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8248.

avatar dgt41 dgt41 - test_item - 4 Nov 2015 - Tested successfully
avatar dgt41
dgt41 - comment - 4 Nov 2015

I have tested this item :white_check_mark: successfully on 92225ca


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8248.

avatar zero-24 zero-24 - change - 4 Nov 2015
Status Pending Ready to Commit
Easy No Yes
avatar zero-24
zero-24 - comment - 4 Nov 2015

RTC. Thanks.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8248.

avatar joomla-cms-bot joomla-cms-bot - change - 4 Nov 2015
Labels Added: ?
avatar wilsonge wilsonge - close - 4 Nov 2015
avatar joomla-cms-bot joomla-cms-bot - close - 4 Nov 2015
avatar wilsonge wilsonge - reference | 922102d - 4 Nov 15
avatar wilsonge wilsonge - merge - 4 Nov 2015
avatar wilsonge wilsonge - change - 4 Nov 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-11-04 15:07:40
Closed_By wilsonge
avatar wilsonge wilsonge - close - 4 Nov 2015
avatar joomla-cms-bot joomla-cms-bot - change - 4 Nov 2015
Labels Removed: ?
avatar wilsonge
wilsonge - comment - 4 Nov 2015

Merged - thanks guys :smiley:

avatar zero-24
zero-24 - comment - 4 Nov 2015

A hug thank you goes to @phproberto :+1: That is great stuff!

avatar phproberto
phproberto - comment - 4 Nov 2015

Thanks to everybody involved in testing, commenting, improving and merging :dancer:

avatar phproberto phproberto - head_ref_deleted - 4 Nov 2015
avatar roland-d
roland-d - comment - 4 Nov 2015

Thank you @phproberto for your contribution.

Add a Comment

Login with GitHub to post a comment