From c7d95776491f57b9c1959c895d791ba5bb3dedaf Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 11 Dec 2017 13:34:54 -0700 Subject: [PATCH] Fix custom contact got changed to template element title when creating project from template --- infolog/inc/class.infolog_datasource.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infolog/inc/class.infolog_datasource.inc.php b/infolog/inc/class.infolog_datasource.inc.php index 0c1dfd0861..16d9fbe22b 100644 --- a/infolog/inc/class.infolog_datasource.inc.php +++ b/infolog/inc/class.infolog_datasource.inc.php @@ -165,7 +165,7 @@ class infolog_datasource extends datasource $old_link = $info['info_link_id'] ? Link::get_link($info['info_link_id']) : $info['info_link']; $info['info_link_id'] = Link::link('projectmanager',$target,'infolog',$info['info_id'],$element['pe_remark'],0,0,1); $info['pm_id'] = $target; - if (!$info['info_from'] || $old_link && $info['info_from'] == $old_link['title']) + if (!$info['info_from'] || $old_link && (int)$old_link['id'] && $info['info_from'] == $old_link['title']) { $info['info_from'] = Link::title('projectmanager',$target); } @@ -174,7 +174,7 @@ class infolog_datasource extends datasource $info['info_status'] = $this->infolog_bo->activate($info); } $this->infolog_bo->write($info); - + // creating again all links, beside the one to the source-project foreach(Link::get_links('infolog',$element['pe_app_id']) as $link) {