Page MenuHomePhabricator

[M] MediaSearch: Selecting Image size/File type filters with empty search never loads the results
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

  1. On Special:MediaSearch do not enter any search items but select any options in Image size/File type filters.
  2. Selecting the filter option (without clicking on the Search button) starts search request which would never finish (click the animated gif below:

Screen Shot 2020-08-28 at 4.19.03 PM.png (482×901 px, 50 KB)

Note: The issue may easily happen during normal search activity - a user gets some results, then clears the search results, decides to select some options on Image size/Filter type filters first and would face the issue described above.

Event Timeline

Etonkovidova renamed this task from MediaSearch: Selecting Image size/File type filters with empty search never finishes loading the response to MediaSearch: Selecting Image size/File type filters with empty search never loads the results.Aug 28 2020, 11:37 PM

@mwilliams - we are assuming that the best way to handle this is to disable all filters until the results show. Can you confirm?

CBogen renamed this task from MediaSearch: Selecting Image size/File type filters with empty search never loads the results to [M] MediaSearch: Selecting Image size/File type filters with empty search never loads the results.Sep 9 2020, 4:28 PM

There is one issue with disabling the filters based on whether or not there are any results:

Say the user has some results, and selects a filter that comes back with zero results (say, all the results are JPEG files and they filter for TIFF). Now the controls will be disabled and they can't restore the previous search without hitting the "X" button to clear.

I think the real issue is that we should ensure the API call to perform a search is never performed until a term has been provided (I think that's what is happening in @Etonkovidova's initial scenario).

We could disable the filters until a term has been input in addition to this, if we want to make things really obvious to the user, but I'm not entirely sure that's necessary; maybe someone wants to set the filters and then enter a term; that's not necessarily a problem as long as we don't perform an invalid search behind the scenes.

Change 627380 had a related patch set uploaded (by Eric Gardner; owner: Eric Gardner):
[mediawiki/extensions/WikibaseMediaInfo@master] Add a guard clause to resetCountAndLoadMore method

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

Agree with @egardner here, lets just not perform the search until a search query has been entered. If things are still feeling weird after that we can look into changing the UI.

Change 627380 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Add a guard clause to resetCountAndLoadMore method

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

Agree with @egardner here, lets just not perform the search until a search query has been entered. If things are still feeling weird after that we can look into changing the UI.

Works as described - select filters (and no search items) and no search is performed.

Checked in commons wmf.10 - works as expected.