Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ protected function _isClientSideValueOk($value): bool
if (!array_key_exists($key, $value)) {
return false;
}
/** this is currently entangled to {@see Input::withValue()} */
if (null === $value[$key]) {
continue;
}
if (!$input->isClientSideValueOk($value[$key])) {
return false;
}
Expand Down
29 changes: 29 additions & 0 deletions components/ILIAS/UI/tests/Component/Input/Field/GroupInputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,35 @@ public function testGroupForwardsValuesOnWithValue(): void
$this->assertNotSame($this->group, $new_group);
}

public function testGroupForwardsNullWithoutValidationOnWithValue(): void
{
$this->child1
->expects($this->once())
->method("withValue")
->with(1)
->willReturn($this->child2);
$this->child1
->expects($this->once())
->method("isClientSideValueOk")
->with(1)
->willReturn(true);
$this->child2
->expects($this->once())
->method("withValue")
->with(null)
->willReturn($this->child1);
$this->child2
->expects($this->never())
->method("isClientSideValueOk")
->with(null)
->willReturn(true);

$new_group = $this->group->withValue([1, null]);

$this->assertEquals([$this->child2, $this->child1], $new_group->getInputs());
$this->assertNotSame($this->group, $new_group);
}

public function testWithValuePreservesKeys(): void
{
$this->assertNotSame($this->child1, $this->child2);
Expand Down
Loading