Skip to content
Snippets Groups Projects
Commit 8195d203 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Fix: remove the old value from the target and then add the new value

parent 910d310c
Branches
Tags
No related merge requests found
...@@ -165,7 +165,10 @@ class AttributeAlter extends Auth\ProcessingFilter ...@@ -165,7 +165,10 @@ class AttributeAlter extends Auth\ProcessingFilter
if ($this->subject === $this->target) { if ($this->subject === $this->target) {
$value = $new_value; $value = $new_value;
} else if ($this->merge === true) { } else if ($this->merge === true) {
$attributes[$this->target][$value] = $new_value; $attributes[$this->target] = array_values(
array_diff($attributes[$this->target], [$value])
);
$attributes[$this->target][] = $new_value;
} else { } else {
$attributes[$this->target] = [$new_value]; $attributes[$this->target] = [$new_value];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment