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

Fixes #1859: Add ModComments relation to Inventory modules

parent bece55ce
No related branches found
No related tags found
No related merge requests found
......@@ -8,4 +8,18 @@ if (defined('VTIGER_UPGRADE')) {
// Trim the space in value.
$db->pquery('UPDATE vtiger_projecttaskstatus set projecttaskstatus = "Canceled" where projecttaskstatus = "Canceled "', array());
// 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);
}
}
}
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