Commit f775ca2220ea93e34a7932fbc537b4de55c25539 introduced a bug where if you have a nullable setting and you leave it empty (thus turning into NULL) the setting is not persisted. This is due to the following line:
if (!isset($tempResource->{$field->attribute})) return;
It used to be property_exists, but has been changed to isset. Since isset also detected NULL, this skips saving the value when it is NULL.
Suggested fix
if (!array_key_exists($field->attribute, $tempResource->getAttributes())) return;
This checks if the $tempResource has the attribute as an array key in its attributes. It doesn't check whether it's null, just that it's set. This should prevent any cases where undefined attributes get persisted, though is that even possible?
Commit f775ca2220ea93e34a7932fbc537b4de55c25539 introduced a bug where if you have a
nullable
setting and you leave it empty (thus turning intoNULL
) the setting is not persisted. This is due to the following line:It used to be
property_exists
, but has been changed toisset
. Sinceisset
also detectedNULL
, this skips saving the value when it isNULL
.Suggested fix
This checks if the
$tempResource
has the attribute as an array key in its attributes. It doesn't check whether it's null, just that it's set. This should prevent any cases where undefined attributes get persisted, though is that even possible?