bug: Excluding more than two labels does not work #6944

Closed
opened 2025-11-02 07:11:50 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @MGChecker on GitHub (Mar 1, 2021).

Description

If you try to exclude labels by using Alt+Click, after doing this with the third one the exclusion of the first one you selected is removed.

Originally created by @MGChecker on GitHub (Mar 1, 2021). - Gitea version (or commit ref): 1.13.2 - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) https://try.gitea.io/MGChecker/DokuForge2/pulls?q=&type=all&sort=&state=open&labels=-12523%2c-12525&milestone=0&assignee=0 - [ ] No ## Description If you try to exclude labels by using Alt+Click, after doing this with the third one the exclusion of the first one you selected is removed.
GiteaMirror added the type/bug label 2025-11-02 07:11:50 -06:00
Author
Owner

@jaqra commented on GitHub (Mar 10, 2021):

The problem is here:

b7208c727d/web_src/js/index.js (L3761-L3767)

We should change regex like:

// TODO: Remove `regStr` and `newStr` constants;

window.location = href.replace(new RegExp("labels=(-?\\d+)(%2c-?\\d+)*&"), function (match) {
    return match.replace(new RegExp(`(=|c)(${id})(%|&)`), "$1-$2$3");
});

@6543 Can you test and send pr for this please :)

@jaqra commented on GitHub (Mar 10, 2021): The problem is here: https://github.com/go-gitea/gitea/blob/b7208c727d5ffa64905503ce28bf3f7260c4c98c/web_src/js/index.js#L3761-L3767 We should change regex like: ```js // TODO: Remove `regStr` and `newStr` constants; window.location = href.replace(new RegExp("labels=(-?\\d+)(%2c-?\\d+)*&"), function (match) { return match.replace(new RegExp(`(=|c)(${id})(%|&)`), "$1-$2$3"); }); ``` @6543 Can you test and send pr for this please :)
Author
Owner

@6543 commented on GitHub (Mar 11, 2021):

@jaqra didn't helped :/

@6543 commented on GitHub (Mar 11, 2021): @jaqra didn't helped :/
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6944