diff --git a/include/utils/VtlibUtils.php b/include/utils/VtlibUtils.php index b7adac0b3fdee39ee366e5848e851721c415aa8b..4dae719851e93958ad3c034e56a1c42ca3d60518 100644 --- a/include/utils/VtlibUtils.php +++ b/include/utils/VtlibUtils.php @@ -771,8 +771,15 @@ function vtlib_addSettingsLink($linkName, $linkURL, $blockName = false) { //Check entry name exist in DB or not $result = $db->pquery('SELECT 1 FROM vtiger_settings_field WHERE name=?', array($linkName)); if ($result && !$db->num_rows($result)) { - $blockName = ($blockName) ? $blockName : 'LBL_OTHER_SETTINGS'; - $blockId = getSettingsBlockId($blockName);//Check block name exist in DB or not + $blockId = 0; + if ($blockName) { + $blockId = getSettingsBlockId($blockName);//Check block name exist in DB or not + } + + if (!$blockId) { + $blockName = 'LBL_OTHER_SETTINGS'; + $blockId = getSettingsBlockId($blockName);//Check block name exist in DB or not + } //Add block in to DB if not exists if (!$blockId) {