From 9e831b585c05cfe35c05ea8f076fc0c5928c7759 Mon Sep 17 00:00:00 2001
From: satish <satish.dvnk@vtiger.com>
Date: Tue, 7 Feb 2017 21:23:11 +0530
Subject: [PATCH] Fixes #437 - Issue with Migration script design
 660_to_700.php

---
 modules/Migration/schema/660_to_700.php | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/modules/Migration/schema/660_to_700.php b/modules/Migration/schema/660_to_700.php
index dacd0ae8a..79e9fd958 100644
--- a/modules/Migration/schema/660_to_700.php
+++ b/modules/Migration/schema/660_to_700.php
@@ -438,6 +438,21 @@ if(defined('VTIGER_UPGRADE')) {
 	$db->pquery('UPDATE vtiger_currency_info SET currency_symbol=? WHERE currency_name=?', array('E£', 'Egypt, Pounds'));
 
 	//setting is_private value of comments to 0 if internal comments is not supported for that module
+	$modCommentsInstance = Vtiger_Module::getInstance('ModComments');
+	$blockInstance = Vtiger_Block::getInstance('LBL_MODCOMMENTS_INFORMATION', $modCommentsInstance);
+	if ($blockInstance) {
+		$fieldInstance = Vtiger_Field::getInstance('is_private', $modCommentsInstance);
+		if (!$fieldInstance) {
+			$fieldInstance			= new Vtiger_Field();
+			$fieldInstance->name	= 'is_private';
+			$fieldInstance->label	= 'Is Private';
+			$fieldInstance->uitype	= 7;
+			$fieldInstance->column	= 'is_private';
+			$fieldInstance->columntype = 'INT(1) DEFAULT 0';
+			$fieldInstance->typeofdata = 'I~O';
+			$blockInstance->addField($fieldInstance);
+		}
+	}
 	$commentIds = array();
 	$internalCommentModules = Vtiger_Functions::getPrivateCommentModules();
 	$commentsResult = $db->pquery('SELECT vtiger_modcomments.modcommentsid FROM vtiger_modcomments 
-- 
GitLab