New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUGFIX: Detect checked state for bound object collections #1230
BUGFIX: Detect checked state for bound object collections #1230
Conversation
When a collection property with obejcts is bound to a checkbox VH, this change makes sure to check object identifiers against the passed value when automatically determining the `checked` state. Fixes neos#1229
as a bugfix shouldn't this target a lower branch? |
Absolutely, just didn't select the correct branch… |
Ah, there is Travis… |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, but a test should be added for it
Looks good, but yeah, a test would be cool |
@kdambekalns the lowest supported branch is 3.3 - did you not target this on purpose? |
@@ -89,7 +93,22 @@ public function render($checked = null, $multiple = null) | |||
} | |||
if (is_array($propertyValue)) { | |||
if ($checked === null) { | |||
$checked = in_array($valueAttribute, $propertyValue, true); | |||
if (TypeHandling::isSimpleType(TypeHandling::getTypeForValue(current($propertyValue))) === false || Arrays::containsMultipleTypes($propertyValue)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just change this to always walk through the array. Arrays::containsMultipleTypes()
iterates through it anyways.
@kdambekalns sorry, I messed with Git.. |
Regarding 3.3… well, I was just too lazy, AFAIR |
d51f567
to
5f4d4ce
Compare
I think 4.0 as target is fine! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good by reading and green. Fine for me too, to have it 4.0 only. It's a rather featurish bugfix after all :D
When a collection property with objects is bound to a checkbox VH,
this change makes sure to check object identifiers against the passed
value when automatically determining the
checked
state.Fixes #1229