Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#31597 closed Bug (fixed)

"Clear all filters" link removes TO_FIELD_VAR and is always displayed in raw_id_fields popup.

Reported by: frnhr Owned by: frnhr
Component: contrib.admin Version: 3.1
Severity: Release blocker Keywords:
Cc: frnhr Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description (last modified by frnhr)

The new "Clear all filters" link does not play nice with raw_id_fields lookup popup window. The new link is shown in the popup regardless of any filters being selected or not.

Present in 3.1a1.

To reproduce:

  • create two models, ModelA and ModelB
    • create a Foreign key field on ModelA pointing to ModelB
    • create a boolean field on ModelB
  • create an admin page for ModelA
    • add the FK field to raw_id_fields list
  • create an admin page for ModelB
    • add the boolean field to list_filter list
  • open the admin page in a browser
  • click on the "magnifying class" icon for the ModelB field
  • expected:
    • no X Clear all filters link
  • actual:
    • yes X Clear all filters link

Additionally, clicking the link removes _to_field query param, which it should not do (_popup param is correctly preserved).


Attachments (1)

clearallfiltersrawidfields.jpg (203.6 KB ) - added by frnhr 5 years ago.

Download all attachments as: .zip

Change History (10)

by frnhr, 5 years ago

comment:1 by frnhr, 5 years ago

Description: modified (diff)

comment:2 by frnhr, 5 years ago

Owner: changed from nobody to frnhr
Status: newassigned

comment:3 by frnhr, 5 years ago

Cc: frnhr added
Has patch: set
Type: UncategorizedBug
Version: master3.1

comment:4 by Mariusz Felisiak, 5 years ago

Cc: Hasan Ramezani added
Severity: NormalRelease blocker
Summary: New "Clear all filters" shown always in raw_id_fields popup"Clear all filters" link removes TO_FIELD_VAR and is always displayed in raw_id_fields popup.
Triage Stage: UnreviewedAccepted

Thanks.

Clearing "Search" also removes "_to_field", so we should fix this as well (in a separate commit/PR).

comment:5 by Hasan Ramezani, 4 years ago

Cc: Hasan Ramezani removed

comment:6 by Mariusz Felisiak, 4 years ago

comment:7 by Mariusz Felisiak, 4 years ago

Triage Stage: AcceptedReady for checkin

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In 4484bc1b:

Fixed #31597, #31603 -- Corrected admin clear all filters link behavior.

  • Show "Clear all filters" only when any filter is selected.
  • Preserve query string not related with filters.

Co-Authored-By: Hasan Ramezani <hasan.r67@…>

comment:9 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In 47e21d33:

[3.1.x] Fixed #31597, #31603 -- Corrected admin clear all filters link behavior.

  • Show "Clear all filters" only when any filter is selected.
  • Preserve query string not related with filters.

Co-Authored-By: Hasan Ramezani <hasan.r67@…>

Backport of 4484bc1b2f84da6442c9c2bfd95d3f1f7d8f96f7 from master

Note: See TracTickets for help on using tickets.
Back to Top