Index: branches/5.3.x/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r16222 -r16395 --- branches/5.3.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 16222) +++ branches/5.3.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 16395) @@ -1,6 +1,6 @@ Application->GetVar('NamesToSpecialMapping', Array ()); - - if ( getArrayValue($names_mapping, $this->Prefix, $list_name) === false ) { + if ( getArrayValue($this->nameToSpecialMapping, $list_name) === false ) { $list =& $this->GetList($params); } } @@ -352,22 +357,15 @@ $requery = isset($params['requery']) && $params['requery']; $main_list = array_key_exists('main_list', $params) && $params['main_list']; - $names_mapping = $this->Application->GetVar('NamesToSpecialMapping', Array ()); - - if ( !array_key_exists($this->Prefix, $names_mapping) ) { - // create prefix-based array to special mapping storage - $names_mapping[$this->Prefix] = Array (); - } - if ( $list_name && !$requery ) { // list with "list_name" parameter - if ( !array_key_exists($list_name, $names_mapping[$this->Prefix]) ) { + if ( !array_key_exists($list_name, $this->nameToSpecialMapping) ) { // special missing -> generate one $special = $main_list ? $this->Special : $this->BuildListSpecial($params); } else { // get special, formed during list initialization - $special = $names_mapping[$this->Prefix][$list_name]; + $special = $this->nameToSpecialMapping[$list_name]; } } else { @@ -400,8 +398,7 @@ $this->Init($this->Prefix, $special); if ( $list_name ) { - $names_mapping[$this->Prefix][$list_name] = $special; - $this->Application->SetVar('NamesToSpecialMapping', $names_mapping); + $this->nameToSpecialMapping[$list_name] = $special; } return $list; @@ -2646,6 +2643,7 @@ } $form_name = 'kf_' . str_replace('-', '_', $item_prefix) . '_' . $object->GetID(); + $form_name .= '_' . kUtil::crc32(json_encode($params)); $button_icon = isset($params['button_icon']) ? $params['button_icon'] : 'content_mode.png'; $button_class = isset($params['button_class']) ? $params['button_class'] : 'admin-edit-btn'; $button_title = isset($params['button_title']) ? $params['button_title'] : 'la_btn_AdminEditItem'; @@ -3006,25 +3004,28 @@ } /** - * Checks, that requested option is checked inside field value + * Checks, that requested option is checked inside field value. * - * @param Array $params - * @return bool + * @param array $params Tag params. + * + * @return boolean */ - function Selected($params) + protected function Selected(array $params) { + /** @var kDBItem $object */ $object = $this->getObject($params); - /* @var $object kDBItem */ $field = $this->SelectParam($params, 'name,field'); $value = $object->GetDBField($field); - if (strpos($value, '|') !== false) { - $value = explode('|', substr($value, 1, -1)); - return in_array($params['value'], $value); + if ( strpos($value, '|') !== false ) { + $selected_values = explode('|', substr($value, 1, -1)); } + else { + $selected_values = array((string)$value); + } - return $value; + return in_array((string)$params['value'], $selected_values, true); } /**