? ? Success
Pull Request for # 6712

User tests: Successful: Unsuccessful:

avatar Devportobello
Devportobello
17 Apr 2015

Checkbox field does not allow defining a value without being checked
#6712

For easiest test use this custom component: https://github.com/Devportobello/joomla-attach-PR-6794

Test

First sry for my bad english, will try my best.

Dunno if we can test with something actually in Joomla, so if you want you can install my custom component then go to frontend "www.yourdomain.com/?option=com_test"

  • "with default" mean the attribute "value" of checkbox are set with something different that 1
  • "with group" mean the use of fields in xml form definition

Test1
Uncheck all checkbox then submit
-> Checkbox 1 with default and checkbox 2 with default are checked

Test2
Patch with the fix,
Uncheck all checkbox then submit
-> All checkbox are unchecked

DEV

JForm::loadField
-> $field->setup($element, $value, $group) with value = $value or $default
Then
JFormFieldCheckbox::setup
-> empty($this->value) || $this->checked ? null : $this->checked = true;

avatar Devportobello Devportobello - open - 17 Apr 2015
avatar Devportobello Devportobello - change - 17 Apr 2015
Title
Patch 6712 - FieldCheckbox attribute default
Patch #6712 - FieldCheckbox attribute default
avatar brianteeman brianteeman - change - 22 Apr 2015
Rel_Number 6712
Relation Type Pull Request for
avatar zero-24 zero-24 - change - 29 Apr 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 29 Apr 2015
Labels Removed: ?
avatar zero-24 zero-24 - change - 29 Apr 2015
Labels Added: ?
avatar zero-24
zero-24 - comment - 29 Apr 2015

@Devportobello sorry I'm not exactly sure what I need to test? Can you provide a step to step non technical testinstruktion? Thanks :smile:

avatar zero-24 zero-24 - change - 29 Apr 2015
Category Libraries
avatar zero-24 zero-24 - change - 29 Apr 2015
Status New Pending
avatar bertmert
bertmert - comment - 7 May 2015

The goal is to have a checkbox that not just sends a value 0 or 1 if it's un/checked but an own value like somevalue.

Test instructions:

  • Download ZIP of com_test at https://github.com/Devportobello/joomla-attach-PR-6794
  • Install it.
  • Have a look into components/com_test/models/fields/test.xml if you want to.
  • Go to frontend home. Add /?option=com_test to URL.
  • You'll see 2 checkboxes already checked just because the form XML file has set default values to them like
default="somevalue"

. Expected: No checkbox is checked when you open com_test first time.

  • Uncheck both checkboxes. Check all other checkboxes. Click button.
  • All checkboxes are checked after reload but only 2 should be checked.

  • Apply patch: Test again.

But see also comment by @infograf768
#6712 (comment)
that fixes #6712 by using field type checkboxes instead of field type checkbox.

avatar RonakParmar RonakParmar - test_item - 11 Jun 2016 - Tested successfully
avatar RonakParmar
RonakParmar - comment - 11 Jun 2016

I have tested this item successfully on a3eb6b0


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

avatar conconnl conconnl - test_item - 25 Jun 2016 - Tested successfully
avatar conconnl
conconnl - comment - 25 Jun 2016

I have tested this item successfully on a3eb6b0


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

Before patch:
screen shot 2016-06-25 at 14 21 15

After patch:
screen shot 2016-06-25 at 14 22 28

avatar zero-24 zero-24 - change - 25 Jun 2016
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 25 Jun 2016

RTC based on tests. Thanks


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

avatar joomla-cms-bot joomla-cms-bot - change - 25 Jun 2016
Labels Added: ?
avatar roland-d roland-d - change - 25 Jun 2016
Milestone Added:
avatar roland-d roland-d - change - 25 Jun 2016
Milestone Added:
avatar roland-d roland-d - change - 25 Jun 2016
Milestone Removed:
avatar roland-d roland-d - change - 25 Jun 2016
Milestone Added:
avatar roland-d roland-d - change - 25 Jun 2016
Milestone Removed:
avatar rdeutz rdeutz - close - 11 Sep 2016
avatar rdeutz rdeutz - merge - 11 Sep 2016
avatar joomla-cms-bot joomla-cms-bot - close - 11 Sep 2016
avatar joomla-cms-bot joomla-cms-bot - close - 11 Sep 2016
avatar rdeutz rdeutz - change - 11 Sep 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-09-11 15:13:17
Closed_By rdeutz
avatar joomla-cms-bot joomla-cms-bot - change - 11 Sep 2016
Labels Added: ?
Removed: ?

Add a Comment

Login with GitHub to post a comment