Skip to content

Commit b51ae48

Browse files
committed
🛡️ Guard against missing assignment records in department edit and add del_st update path for bot message actions 🔧
- 💬 Add `del_st` field to bot message attribute updates to persist delete status changes - 🚫 Validate department assignment object before removal to prevent fatal errors when record is missing - 📝 Return clear error response if assignment record not found
1 parent 76672a1 commit b51ae48

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎lhc_web/lib/core/lhgenericbot/actionTypes/lhgenericbotactioncommand.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ public static function process($chat, $action, $trigger, $params)
596596
$params['msg']->{$action['content']['payload']} = $contentPayload;
597597
}
598598

599-
if (in_array($action['content']['payload'],['msg','meta_msg','time','chat_id','user_id','name_support'])) {
599+
if (in_array($action['content']['payload'],['del_st','msg','meta_msg','time','chat_id','user_id','name_support'])) {
600600
$params['msg']->updateThis(['update' => [$action['content']['payload']]]);
601601
}
602602

‎lhc_web/modules/lhuser/editdepartment.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@
196196
$response = array('error' => true, 'message' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/subject','Invalid CSRF token'));
197197
}
198198

199+
if (!is_object($userDep)) {
200+
$response = array('error' => true, 'message' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/subject','Assignment record was not found'));
201+
}
202+
199203
$db = ezcDbInstance::get();
200204
$db->beginTransaction();
201205

0 commit comments

Comments
 (0)