diff --git a/pages/ajax.render.php b/pages/ajax.render.php index d0dce4f7a..2b29826b6 100644 --- a/pages/ajax.render.php +++ b/pages/ajax.render.php @@ -1243,12 +1243,13 @@ JS $oShortcutSearch->AddCondition('user_id', UserRights::GetUserId(), '='); $oShortcutSearch->AddCondition('id', $iShortcut, '='); $oShortcutSet = new CMDBObjectSet($oShortcutSearch); - if ($oShortcutSet->Count() === 0) { - throw new SecurityException(Dict::S('UI:ObjectDoesNotExist')); - } $oShortcut = $oShortcutSet->Fetch(); + if ($oShortcut === null) { + throw new SecurityException(Dict::S('UI:ObjectDoesNotExist')); + } + $oShortcut->StartRenameDialog($oPage); break; @@ -1259,12 +1260,12 @@ JS $oShortcutSearch->AddCondition('user_id', UserRights::GetUserId(), '='); $oShortcutSearch->AddCondition('id', $iShortcut, '='); $oShortcutSet = new CMDBObjectSet($oShortcutSearch); - if ($oShortcutSet->Count() === 0) { + $oShortcut = $oShortcutSet->Fetch(); + + if ($oShortcut === null) { throw new SecurityException(Dict::S('UI:ObjectDoesNotExist')); } - $oShortcut = $oShortcutSet->Fetch(); - $sName = utils::ReadParam('attr_name', '', false, 'raw_data'); if (strlen($sName) > 0) { $oShortcut->Set('name', $sName);