diff options
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r-- | engine/lib/entities.php | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index e118125cd..2fa00b849 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -198,7 +198,19 @@ if ((int) $this->guid > 0) { if (!create_metadata($this->getGUID(), $name, $v, $value_type, $this->getOwner(), $this->getAccessID(), $multiple)) return false; } else { - $this->temp_metadata[$name] = $value; + if (($multiple) && (isset($this->temp_metadata[$name]))) + { + if (!is_array($this->temp_metadata[$name])) + { + $tmp = $this->temp_metadata[$name]; + $this->temp_metadata[$name] = array(); + $this->temp_metadata[$name][] = $tmp; + } + + $this->temp_metadata[$name][] = $value; + } + else + $this->temp_metadata[$name] = $value; } } @@ -209,7 +221,22 @@ if ((int) $this->guid > 0) { return create_metadata($this->getGUID(), $name, $value, $value_type, $this->getOwner(), $this->getAccessID(), $multiple); } else { - $this->temp_metadata[$name] = $value; + //$this->temp_metadata[$name] = $value; + + if (($multiple) && (isset($this->temp_metadata[$name]))) + { + if (!is_array($this->temp_metadata[$name])) + { + $tmp = $this->temp_metadata[$name]; + $this->temp_metadata[$name] = array(); + $this->temp_metadata[$name][] = $tmp; + } + + $this->temp_metadata[$name][] = $value; + } + else + $this->temp_metadata[$name] = $value; + return true; } } |