Skip to content
Snippets Groups Projects
Commit 720a2c1c authored by Ruben Estrada's avatar Ruben Estrada
Browse files

#1777 fixes bug that copied empty field contents for non-reference fields when...

#1777 fixes bug that copied empty field contents for non-reference fields when target and source module are the same.
parent c3861257
No related branches found
No related tags found
1 merge request!898fixes issue #1777
......@@ -73,11 +73,8 @@ class VTCreateEntityTask extends VTTask {
if ($fieldValueType == 'fieldname') {
$field = $fieldValue;
$module = $referenceModule;
if ($referenceModule == $entityType) {
$components = vtws_getIdComponents($entity->get($field));
$referenceRecordId = $components[1];
$fieldValue = $referenceRecordId;
} else if (php7_count($matches) > 0) {
if (php7_count($matches) > 0) {
$referenceField = $matches[1];
$referencedModule = $matches[2];
$referencedFieldName = $matches[3];
......@@ -92,7 +89,7 @@ class VTCreateEntityTask extends VTTask {
$referenceFieldFocus = $this->getReferenceFieldFocus($referencedModule, $referenceField, $referenceRecordId);
$fieldValue = $referenceFieldFocus->column_fields[$referencedFieldName];
} else {
$fieldValue = decode_html($focus->column_fields[$fieldValue]);
$fieldValue = decode_html($focus->column_fields[$field]);
}
$moduleModel = Vtiger_Module_Model::getInstance($module);
......
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