mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-01 22:47:19 +00:00
getAttributeValue() checks if value starts with seperator
This commit is contained in:
parent
530d75fdf0
commit
a1f6bd9a7d
|
@ -117,7 +117,16 @@ class SeedDMS_Core_Object { /* {{{ */
|
||||||
$value = $this->_attributes[$attrdef->getId()]->getValue();
|
$value = $this->_attributes[$attrdef->getId()]->getValue();
|
||||||
if($attrdef->getMultipleValues()) {
|
if($attrdef->getMultipleValues()) {
|
||||||
$sep = substr($value, 0, 1);
|
$sep = substr($value, 0, 1);
|
||||||
return(explode($sep, substr($value, 1)));
|
$vsep = $attrdef->getValueSetSeparator();
|
||||||
|
/* If the value doesn't start with the separator used in the value set,
|
||||||
|
* then assume that the value was not saved with a leading separator.
|
||||||
|
* This can happen, if the value was previously a single value from
|
||||||
|
* the value set and later turned into a multi value attribute.
|
||||||
|
*/
|
||||||
|
if($sep == $vsep)
|
||||||
|
return(explode($sep, substr($value, 1)));
|
||||||
|
else
|
||||||
|
return(array($value));
|
||||||
} else {
|
} else {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user