Skip to content
Snippets Groups Projects
Commit 7e8e61d2 authored by Prasad's avatar Prasad
Browse files

Fixes #450: New picklist value added multiple times during Import

parent 2b3a8aa2
No related branches found
No related tags found
No related merge requests found
......@@ -637,9 +637,17 @@ class Import_Data_Action extends Vtiger_Action_Controller {
if (!in_array($picklistValueInLowerCase, $allPicklistValuesInLowerCase) && !empty($picklistValueInLowerCase)) {
if ($moduleName != 'Calendar') {
// Required to update runtime cache.
$wsFieldDetails = $fieldInstance->getPicklistDetails();
$moduleObject = Vtiger_Module::getInstance($moduleName);
$fieldObject = Vtiger_Field::getInstance($fieldName, $moduleObject);
$fieldObject->setPicklistValues(array($fieldValue));
// Update cache state with new value added.
$wsFieldDetails[] = array('label' => $fieldValue, 'name' => $fieldValue);
Vtiger_Cache::getInstance()->setPicklistDetails($moduleObject->getId(), $fieldObject->getName(), $wsFieldDetails);
unset($this->allPicklistValues[$fieldName]);
}
} else {
......@@ -1160,4 +1168,4 @@ class Import_Data_Action extends Vtiger_Action_Controller {
return $entityIdsList;
}
}
?>
\ No newline at end of file
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment