Unverified Commit 5ce8aaf7 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(ObjectsAttribute) Improve behavior when setting values

issue #6083
Showing with 14 additions and 1 deletion
+14 -1
...@@ -63,6 +63,13 @@ class GenericDialogAttribute extends DialogAttribute ...@@ -63,6 +63,13 @@ class GenericDialogAttribute extends DialogAttribute
unset($this->value[$row]); unset($this->value[$row]);
} }
function setValue ($value)
{
parent::setValue($value);
$this->displays = [];
$this->getDisplayValues();
}
protected function sortValues () protected function sortValues ()
{ {
asort($this->value); asort($this->value);
...@@ -113,7 +120,7 @@ class GenericDialogAttribute extends DialogAttribute ...@@ -113,7 +120,7 @@ class GenericDialogAttribute extends DialogAttribute
if ($this->isTemplate() && ($attrs === NULL)) { if ($this->isTemplate() && ($attrs === NULL)) {
$this->displays[$i] = $this->value[$i]; $this->displays[$i] = $this->value[$i];
} elseif (!isset($attrs[$this->display_attr])) { } elseif (!isset($attrs[$this->display_attr])) {
unset($this->value[$i]); $this->removeValue($i);
} else { } else {
if ($this->display_attr == 'dn') { if ($this->display_attr == 'dn') {
$this->displays[$i] = $attrs['dn']; $this->displays[$i] = $attrs['dn'];
......
...@@ -175,6 +175,12 @@ class ObjectsAttribute extends GenericDialogAttribute ...@@ -175,6 +175,12 @@ class ObjectsAttribute extends GenericDialogAttribute
return $display; return $display;
} }
function setValue ($value)
{
$this->types = [];
parent::setValue($value);
}
protected function removeValue ($row) protected function removeValue ($row)
{ {
parent::removeValue($row); parent::removeValue($row);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment