Skip to content

Commit fab4232

Browse files
committed
#382 Fix setting bool field with null
1 parent 932488c commit fab4232

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/Opus/Model/Field.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public function setValue($value)
328328
case 'bool':
329329
// Initially the stored value is null which matches false, but field needs to be set
330330
// TODO better way?
331-
if ((bool) $value === (bool) $this->value && ! $this->value === null) {
331+
if ((bool) $value === (bool) $this->value && ($this->value !== null || $value === null)) {
332332
return $this;
333333
}
334334
break;

0 commit comments

Comments
 (0)