User tests: Successful: Unsuccessful:
if value attribute is present in the xml of a field it should be evaluated as its default value.
Check issue #3158
Labels |
Several questions:
$this->checkedValue
? Why not just use $value
or $this->value
here?Always keep in mind that those formfields may be extended by 3rd party extensions. Any changes to the fields need to be backward compatible.
Why the change to the default behavior in the FormField class? This could be a BC break depending what the extending class does with the default value. Imho, this isn't needed to adress the issue at hand.
I introduced the default
property in the generic field class. Checkout the commit just before I introduced https://github.com/joomla/joomla-cms/blob/6234151121a601d3659f2d4da9b2eab441699223/libraries/joomla/form/field.php
Why removing the default value handling in the checkbox field? I know it doesn't work fine out of the box, but it may do if taken care properly outside of the form.
If we consider the document http://docs.joomla.org/Checkbox_form_field_type and the code how it is implemented before https://github.com/joomla/joomla-cms/blob/6234151121a601d3659f2d4da9b2eab441699223/libraries/joomla/form/fields/checkbox.php#L46 then after this PR it will get rollbacked.
I didn't test it, but why the introduction of $this->checkedValue? Why not just use $value or $this->value here?
If developer wants to change the value of checkbox I mean value
present in <field type="checkbox" value="foobar" default="1"/>
then he can now do that by writing $field->checkedValue = "New Foo Bar";
.
Since we have value
as property with every form field and it never contains $element['value'] so I added checkedValue i.e. https://github.com/joomla/joomla-cms/pull/3167/files#diff-af68d51c5d6b15538c81b99ccd0dd1e6R42
If people have started using $this->default
then we can add back but currently it is only used in checkbox. There is no harm in having default
.
This time I specially added UT's to make sure that after refactorization checkbox field interface match up with doc.
Labels |
Added:
?
|
Labels |
Status | New | ⇒ | Pending |
Labels |
Removed:
?
|
Category | ⇒ | Libraries |
Title |
|
Title |
|
It would be helpful to have some test instructions - willing to test but there isn't any detail on what I'm actually looking for.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3167.
@Achal-Aggarwal Please provide test instructions otherwise your PR can't be tested.
Title |
|
||||||
Status | Pending | ⇒ | Closed | ||||
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-05-04 16:53:56 | ||||
Closed_By | ⇒ | roland-d |
Title |
|
Title |
|
#3159