mvc: allow to unset attribute via setAttributeValue

SimpleXML elements have no way of removing attributes so let
the base field do the work.
This commit is contained in:
Franco Fichtner 2021-07-20 16:46:58 +02:00
parent 8d20e2587d
commit 073681f895

View File

@ -376,7 +376,11 @@ abstract class BaseField
*/
public function setAttributeValue($key, $value)
{
$this->internalAttributes[$key] = $value;
if ($value !== null) {
$this->internalAttributes[$key] = $value;
} elseif (isset($this->internalAttributes[$key])) {
unset($this->internalAttributes[$key]);
}
}
/**