Page MenuHomePhabricator

NewPagesFeed filters: selecting "Keyword search" then typing nothing adds a chip that says "Has keyword: $1" and searches for something unexpected
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Visit Special:NewPagesFeed
  • Click "Set filters"
  • Click the "Keyword search" radio button
  • Make sure the keyword search box is empty
  • Click "Set filters"

What happens?:

  • "Has keyword: $1" chip
  • 9,021 results
  • API is doing some kind of filtering, perhaps for the number "1", e.g. LIKE '%1%'

What should have happened instead?:

  • no "Has keyword" chip
  • 13,623 results
  • API should silently ignore this blank keyword filter because it is invalid

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Details

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
  1. I think all these options, including keywords, should be checkboxes, not radios. You can then add different criteria and disable some of them, like this field.
  2. I think, there should not be radios and checkboxes next to the inputs. Emptying field should be enough.
  1. I think all these options, including keywords, should be checkboxes, not radios. You can then add different criteria and disable some of them, like this field.
  2. I think, there should not be radios and checkboxes next to the inputs. Emptying field should be enough.

It is not a checkbox for technical reasons (I am afraid that the worst-case scenario of filtering for everything will lead to a significant load on the DB query)

  1. I think all these options, including keywords, should be checkboxes, not radios. You can then add different criteria and disable some of them, like this field.
  2. I think, there should not be radios and checkboxes next to the inputs. Emptying field should be enough.

It is not a checkbox for technical reasons (I am afraid that the worst-case scenario of filtering for everything will lead to a significant load on the DB query)

OK, found T330593

I like Wargo's idea, but it would be a more complicated solution. So I think it's good that that's a separate ticket.

The fix here is probably to add a check to the "Set filters" function that is something like...

if ( keywordRadioButtonIsTicked && keywordTextBox === '' ) {
    untickKeywordRadioButtion();
    tickShowAll();
}

This logic should be placed before the code that generates the chips and before the API call.

Change #1098610 had a related patch set uploaded (by Scardenasmolinar; author: Scardenasmolinar):

[mediawiki/extensions/PageTriage@master] Check if keyword is not blank when adding info chips

https://gerrit.wikimedia.org/r/1098610

Scardenasmolinar changed the task status from Open to In Progress.Nov 27 2024, 11:09 PM
Scardenasmolinar claimed this task.
Scardenasmolinar moved this task from Ready to In Progress on the Moderator-Tools-Team (Kanban) board.

This patch is now ready for review! I also fixed the same bug that was happening in AFC.

Change #1098610 merged by jenkins-bot:

[mediawiki/extensions/PageTriage@master] Check if keyword textbox is not blank

https://gerrit.wikimedia.org/r/1098610

Scardenasmolinar moved this task from QA to Done on the Moderator-Tools-Team (Kanban) board.

I can verify that this bug no longer appears in NPP in the enwiki. If the issue occurs again, please reopen this ticket or create a new one.