mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 12:11:19 +00:00
make sure boolean attribute is set to 0/1
This commit is contained in:
parent
52344c0842
commit
e4c229854e
|
@ -139,6 +139,11 @@ class SeedDMS_Core_Object { /* {{{ */
|
|||
if (!$this->_attributes) {
|
||||
$this->getAttributes();
|
||||
}
|
||||
switch($attrdef->getType()) {
|
||||
case SeedDMS_Core_AttributeDefinition::type_boolean:
|
||||
$value = ($value === true || $value != '' || $value == 1) ? 1 : 0;
|
||||
break;
|
||||
}
|
||||
if($attrdef->getMultipleValues() && is_array($value)) {
|
||||
$sep = substr($attrdef->getValueSet(), 0, 1);
|
||||
$value = $sep.implode($sep, $value);
|
||||
|
|
Loading…
Reference in New Issue
Block a user