From 48e067e4b36c2b6d757d288e93e47d6f4a263250 Mon Sep 17 00:00:00 2001 From: Shudhanshu Singh Date: Wed, 22 Jul 2026 22:14:27 +0530 Subject: [PATCH] fix(issue): make issue action (issue list batch operation) elements have correct attributes (#38575) The "Clear projects" action in the issue list batch operations doesn't work. When users select multiple issues and choose to clear their project assignments, the operation fails because: 1. The frontend sends a project ID of `0` to represent "no project" 2. The backend passes this invalid ID directly to `IssueAssignOrRemoveProject` without filtering 3. The backend tries to look up a project with ID `0`, which doesn't exist, resulting in a `project 0 not found` error 4. Selected issues remain assigned to their projects instead of being removed Fixes #38571 ## Root Cause The issue is a regression from the multi-project feature (#36784). The frontend was using `data-element-id="0"` to represent "clear" actions, but the backend doesn't filter out this invalid ID before validation. ## Solution ### Template Changes (`templates/repo/issue/filter_actions.tmpl`) - Changed `data-element-id="0"` to `data-element-id=""` for the "Clear projects" action (line 78) - Changed `data-element-id="0"` to `data-element-id=""` for the "Clear milestone" action (line 47) - Removed the duplicate "no select" assignee option that was using `data-element-id="0"` (lines 116-118) ### Frontend Logic Changes (`web_src/js/features/repo-issue-list.ts`) - Made `elementId` a `const` instead of `let` (line 60) to prevent mutations - Removed the workaround code that was trying to handle `data-element-id="0"` for assignees (lines 65-69) - Updated comment from "for toggle" to "for label toggle" for clarity (line 71) --------- Signed-off-by: Sudhanshu Singh Co-authored-by: wxiaoguang --- templates/repo/issue/filter_actions.tmpl | 7 ++----- web_src/js/features/repo-issue-list.ts | 10 ++-------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/templates/repo/issue/filter_actions.tmpl b/templates/repo/issue/filter_actions.tmpl index 4c9366a645..3729c467c1 100644 --- a/templates/repo/issue/filter_actions.tmpl +++ b/templates/repo/issue/filter_actions.tmpl @@ -44,7 +44,7 @@ {{svg "octicon-triangle-down" 14 "dropdown icon"}}