diff --git a/modules/Migration/schema/811_to_812.php b/modules/Migration/schema/811_to_812.php index 52e8bbfa3c698e606e1a7a8d49024c0c1a280338..a0c51c0ef14ae791d4222d057a03d9a7fdfdb2ca 100644 --- a/modules/Migration/schema/811_to_812.php +++ b/modules/Migration/schema/811_to_812.php @@ -11,21 +11,21 @@ if (defined('VTIGER_UPGRADE')) { // Ensure related-tab for ModComments on Inventory modules (if missed in previous migration) $modCommentsInstance = Vtiger_Module_Model::getInstance('ModComments'); - $modCommentFieldInstance = Vtiger_Field_Model::getInstance('related_to', $modCommentsInstance); - foreach(getInventoryModules() as $refModuleName) { - $refModuleModel = Vtiger_Module_Model::getInstance($refModuleName); - $rs = $db->pquery("SELECT 1 FROM vtiger_relatedlists WHERE tabid=? and related_tabid=? and relationfieldid=? limit 1", array( - $refModuleModel->id, $modCommentsInstance->id, $modCommentFieldInstance->id - )); - if (!$db->num_rows($rs)) { - $refModuleModel->setRelatedList($modCommentsInstance, "ModComments", '', 'get_comments', $modCommentFieldInstance->id); - } - } + $modCommentFieldInstance = Vtiger_Field_Model::getInstance('related_to', $modCommentsInstance); + foreach(getInventoryModules() as $refModuleName) { + $refModuleModel = Vtiger_Module_Model::getInstance($refModuleName); + $rs = $db->pquery("SELECT 1 FROM vtiger_relatedlists WHERE tabid=? and related_tabid=? and relationfieldid=? limit 1", array( + $refModuleModel->id, $modCommentsInstance->id, $modCommentFieldInstance->id + )); + if (!$db->num_rows($rs)) { + $refModuleModel->setRelatedList($modCommentsInstance, "ModComments", '', 'get_comments', $modCommentFieldInstance->id); + } + } - // Resize column width to text (instead of varchar) - $db->pquery("ALTER TABLE vtiger_shorturls MODIFY COLUMN handler_data text"); + // Resize column width to text (instead of varchar) + $db->pquery("ALTER TABLE vtiger_shorturls MODIFY COLUMN handler_data text"); - // Disabling the mass edit for the inventory line item fields. - $db->pquery("UPDATE vtiger_field set masseditable = 0 where columnname in ('discount_percent','discount_amount') - and tablename in ('vtiger_quotes','vtiger_purchaseorder','vtiger_salesorder','vtiger_invoice')", array()); + // Disabling the mass edit for the inventory line item discount fields. + $db->pquery("UPDATE vtiger_field set masseditable = 0 where columnname in ('discount_percent','discount_amount') + and tablename in ('vtiger_quotes','vtiger_purchaseorder','vtiger_salesorder','vtiger_invoice')", array()); }