Skip to content

Commit

Permalink
Patch setValue issue with Checkbox element
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksagona committed Aug 18, 2021
1 parent bcac032 commit 5883487
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":{"Pop\\Form\\Test\\FieldsTest::testCreateCsrfAndCaptcha":3},"times":{"Pop\\Form\\Test\\AclFormTest::testAclFormConfig":0.008,"Pop\\Form\\Test\\AclFormTest::testAclFormDeny":0.002,"Pop\\Form\\Test\\AclFormTest::testAclFormDenyStrict":0.002,"Pop\\Form\\Test\\ButtonTest::testConstructor":0.001,"Pop\\Form\\Test\\ButtonTest::testSubmit":0.001,"Pop\\Form\\Test\\ButtonTest::testReset":0.001,"Pop\\Form\\Test\\CheckboxSetTest::testConstructor":0.001,"Pop\\Form\\Test\\CheckboxSetTest::testValidate":0.001,"Pop\\Form\\Test\\CheckboxSetTest::testValidateRequired":0.001,"Pop\\Form\\Test\\CheckboxSetTest::testDisabled":0.001,"Pop\\Form\\Test\\CheckboxSetTest::testRemoveDisabled":0.001,"Pop\\Form\\Test\\CheckboxSetTest::testReadonly":0.001,"Pop\\Form\\Test\\CheckboxSetTest::testRemoveReadonly":0.001,"Pop\\Form\\Test\\CheckboxSetTest::testSetTabIndex":0.001,"Pop\\Form\\Test\\ElementTest::testConstructor":0.001,"Pop\\Form\\Test\\ElementTest::testSetLabel":0.001,"Pop\\Form\\Test\\ElementTest::testSetLabelWithAttributes":0.001,"Pop\\Form\\Test\\ElementTest::testSetLabelAttributes":0.001,"Pop\\Form\\Test\\ElementTest::testSetHint":0.001,"Pop\\Form\\Test\\ElementTest::testSetHintWithAttributes":0.001,"Pop\\Form\\Test\\ElementTest::testSetHintAttributes":0.001,"Pop\\Form\\Test\\ElementTest::testSetValidators":0.001,"Pop\\Form\\Test\\ElementTest::testAddValidator":0.001,"Pop\\Form\\Test\\ElementTest::testAddValidators":0.001,"Pop\\Form\\Test\\ElementTest::testAddValidatorException":0.001,"Pop\\Form\\Test\\ElementTest::testRender":0.001,"Pop\\Form\\Test\\ElementTest::testValidate":0.001,"Pop\\Form\\Test\\ElementTest::testValidateRequired":0.001,"Pop\\Form\\Test\\ElementTest::testValidateNotEmpty":0.001,"Pop\\Form\\Test\\ElementTest::testValidateClosure":0.001,"Pop\\Form\\Test\\FieldsTest::testCreate":0.005,"Pop\\Form\\Test\\FieldsTest::testCreateCsrfAndCaptcha":0.004,"Pop\\Form\\Test\\FieldsTest::testTypeNotSetException":0.001,"Pop\\Form\\Test\\FieldsTest::testClassDoesNotExistException":0.001,"Pop\\Form\\Test\\FieldsTest::testGetConfigFromTable":0.005,"Pop\\Form\\Test\\FieldsTest::testTableNameNotSetException":0.001,"Pop\\Form\\Test\\FieldsTest::testGetConfigFromTableAttribsAndConfig":0.001,"Pop\\Form\\Test\\FieldsTest::testGetConfigFromTableConfig":0.001,"Pop\\Form\\Test\\FieldsetTest::testConstructor":0.001,"Pop\\Form\\Test\\FieldsetTest::testCreateFromConfig":0.002,"Pop\\Form\\Test\\FieldsetTest::testPrepareTable":0.001,"Pop\\Form\\Test\\FieldsetTest::testPrepareDiv":0.001,"Pop\\Form\\Test\\FieldsetTest::testPrepareLegend":0.001,"Pop\\Form\\Test\\FilterTest::testHasAndGetters":0.002,"Pop\\Form\\Test\\FilterTest::testFilterArrayValue":0.001,"Pop\\Form\\Test\\FormConfigTest::testToJson1":0.001,"Pop\\Form\\Test\\FormConfigTest::testToJson2":0.001,"Pop\\Form\\Test\\FormConfigTest::testFromJson1":0.001,"Pop\\Form\\Test\\FormConfigTest::testFromJson2":0.001,"Pop\\Form\\Test\\FormTest::testConstructor":0.001,"Pop\\Form\\Test\\FormTest::testSetAttributes":0.001,"Pop\\Form\\Test\\FormTest::testSetCurrent":0.001,"Pop\\Form\\Test\\FormTest::testCreateFromConfig1":0.001,"Pop\\Form\\Test\\FormTest::testCreateFromConfig2":0.001,"Pop\\Form\\Test\\FormTest::testCreateFromFieldsetConfig1":0.001,"Pop\\Form\\Test\\FormTest::testCreateFromFieldsetConfig2":0.001,"Pop\\Form\\Test\\FormTest::testCreateAndRemoveFieldset":0.001,"Pop\\Form\\Test\\FormTest::testRemoveField":0.001,"Pop\\Form\\Test\\FormTest::testFilterValue":0.001,"Pop\\Form\\Test\\FormTest::testInsertAfter":0.001,"Pop\\Form\\Test\\FormTest::testInsertBefore":0.001,"Pop\\Form\\Test\\FormTest::testToArray":0.001,"Pop\\Form\\Test\\FormTest::testIterator":0.001,"Pop\\Form\\Test\\FormTest::testAddFilter":0.002,"Pop\\Form\\Test\\FormTest::testAddColumn1":0.002,"Pop\\Form\\Test\\FormTest::testAddColumn2":0.001,"Pop\\Form\\Test\\FormTest::testIsValid":0.002,"Pop\\Form\\Test\\FormTest::testValidateCallable":0.002,"Pop\\Form\\Test\\FormTest::testValidateCallables":0.002,"Pop\\Form\\Test\\FormTest::testToString":0.001,"Pop\\Form\\Test\\FormTest::testClear":0.004,"Pop\\Form\\Test\\FormValidatorTest::testConstructor":0.002,"Pop\\Form\\Test\\FormValidatorTest::testGettersAndSetters":0.001,"Pop\\Form\\Test\\FormValidatorTest::testFilters":0.001,"Pop\\Form\\Test\\FormValidatorTest::testFilterValues":0.001,"Pop\\Form\\Test\\FormValidatorTest::testFilterValueException":0.001,"Pop\\Form\\Test\\FormValidatorTest::testValidate":0.001,"Pop\\Form\\Test\\FormValidatorTest::testValidateSingleFields":0.001,"Pop\\Form\\Test\\FormValidatorTest::testValidateCallable":0.001,"Pop\\Form\\Test\\FormValidatorTest::testValidateCallables":0.001,"Pop\\Form\\Test\\FormValidatorTest::testMagicMethods":0.001,"Pop\\Form\\Test\\InputTest::testButton":0.001,"Pop\\Form\\Test\\InputTest::testColor":0.001,"Pop\\Form\\Test\\InputTest::testDate":0.001,"Pop\\Form\\Test\\InputTest::testMonth":0.001,"Pop\\Form\\Test\\InputTest::testSearch":0.001,"Pop\\Form\\Test\\InputTest::testTel":0.001,"Pop\\Form\\Test\\InputTest::testTime":0.001,"Pop\\Form\\Test\\InputTest::testWeek":0.001,"Pop\\Form\\Test\\InputTest::testCheckbox":0.001,"Pop\\Form\\Test\\InputTest::testDatalist":0.001,"Pop\\Form\\Test\\InputTest::testEmail":0.001,"Pop\\Form\\Test\\InputTest::testFile":0.001,"Pop\\Form\\Test\\InputTest::testFileValidateRequired":0.001,"Pop\\Form\\Test\\InputTest::testHidden":0.001,"Pop\\Form\\Test\\InputTest::testNumber":0.001,"Pop\\Form\\Test\\InputTest::testPassword":0.001,"Pop\\Form\\Test\\InputTest::testRadio":0.001,"Pop\\Form\\Test\\InputTest::testRange":0.001,"Pop\\Form\\Test\\InputTest::testReset":0.001,"Pop\\Form\\Test\\InputTest::testSubmit":0.001,"Pop\\Form\\Test\\InputTest::testText":0.001,"Pop\\Form\\Test\\InputTest::testUrl":0.001,"Pop\\Form\\Test\\InputTest::testRemoveRequired":0.001,"Pop\\Form\\Test\\InputTest::testDisabled":0.001,"Pop\\Form\\Test\\InputTest::testRemoveDisabled":0.001,"Pop\\Form\\Test\\InputTest::testReadonly":0.001,"Pop\\Form\\Test\\InputTest::testRemoveReadonly":0.001,"Pop\\Form\\Test\\InputTest::testCaptcha":0.004,"Pop\\Form\\Test\\InputTest::testCsrf":0.003,"Pop\\Form\\Test\\RadioSetTest::testConstructor":0.001,"Pop\\Form\\Test\\RadioSetTest::testValidate":0.001,"Pop\\Form\\Test\\RadioSetTest::testValidateRequired":0.001,"Pop\\Form\\Test\\RadioSetTest::testDisabled":0.001,"Pop\\Form\\Test\\RadioSetTest::testRemoveDisabled":0.001,"Pop\\Form\\Test\\RadioSetTest::testReadonly":0.001,"Pop\\Form\\Test\\RadioSetTest::testRemoveReadonly":0.001,"Pop\\Form\\Test\\RadioSetTest::testSetTabIndex":0.001,"Pop\\Form\\Test\\SelectTest::testConstructor":0.001,"Pop\\Form\\Test\\SelectTest::testConstructorMultiple":0.001,"Pop\\Form\\Test\\SelectTest::testOptGroup":0.001,"Pop\\Form\\Test\\SelectTest::testOptGroupAddOptions":0.001,"Pop\\Form\\Test\\SelectTest::testOptGroupMultiple":0.001,"Pop\\Form\\Test\\SelectTest::testSelected":0.001,"Pop\\Form\\Test\\SelectTest::testMultipleSelected":0.001,"Pop\\Form\\Test\\SelectTest::testValidate":0.001,"Pop\\Form\\Test\\SelectTest::testValidateRequired":0.001,"Pop\\Form\\Test\\SelectTest::testParseYear1":0.005,"Pop\\Form\\Test\\SelectTest::testParseYear2":0.004,"Pop\\Form\\Test\\SelectTest::testParseYear3":0.001,"Pop\\Form\\Test\\SelectTest::testParseMonthsShort":0.001,"Pop\\Form\\Test\\SelectTest::testParseDaysOfMonths":0.001,"Pop\\Form\\Test\\SelectTest::testParseHours24":0.001,"Pop\\Form\\Test\\SelectTest::testParseMinutes":0.002,"Pop\\Form\\Test\\SelectTest::testParseMinutes5":0.001,"Pop\\Form\\Test\\SelectTest::testParseMinutes10":0.001,"Pop\\Form\\Test\\SelectTest::testParseMinutes15":0.001,"Pop\\Form\\Test\\SelectTest::testParseData":0.004,"Pop\\Form\\Test\\SelectTest::testRemoveRequired":0.001,"Pop\\Form\\Test\\SelectTest::testDisabled":0.001,"Pop\\Form\\Test\\SelectTest::testRemoveDisabled":0.001,"Pop\\Form\\Test\\SelectTest::testReadonly":0.001,"Pop\\Form\\Test\\SelectTest::testRemoveReadonly":0.001,"Pop\\Form\\Test\\TextareaTest::testConstructor":0.001,"Pop\\Form\\Test\\TextareaTest::testValidate":0.001,"Pop\\Form\\Test\\TextareaTest::testValidateRequired":0.001,"Pop\\Form\\Test\\TextareaTest::testRemoveRequired":0.001,"Pop\\Form\\Test\\TextareaTest::testDisabled":0.001,"Pop\\Form\\Test\\TextareaTest::testRemoveDisabled":0.001,"Pop\\Form\\Test\\TextareaTest::testReadonly":0.001,"Pop\\Form\\Test\\TextareaTest::testRemoveReadonly":0.001,"Pop\\Form\\Test\\ViewTest::testSetStreamTemplate":0.001}}
3 changes: 2 additions & 1 deletion src/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,8 @@ public function filterValue($field)
$realValue = $filter->filter($realValue, $name, $type);
}

if (($field instanceof Element\AbstractElement) && (null !== $realValue) && ($realValue != '')) {
if (($field instanceof Element\AbstractElement) && !($field instanceof Element\Input\Checkbox) &&
!($field instanceof Element\Input\Radio) && (null !== $realValue) && ($realValue != '')) {
$field->setValue($realValue);
}

Expand Down

0 comments on commit 5883487

Please sign in to comment.