[Django] #31597: New "Clear all filters" shown always in raw_id_fields popup

13 views
Skip to first unread message

Django

unread,
May 16, 2020, 3:16:37 PM5/16/20
to django-...@googlegroups.com
#31597: New "Clear all filters" shown always in raw_id_fields popup
-----------------------------------------+------------------------
Reporter: frnhr | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-----------------------------------------+------------------------
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).

[[Image(clearallfiltersrawidfields.png)]]

--
Ticket URL: <https://code.djangoproject.com/ticket/31597>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 16, 2020, 3:19:14 PM5/16/20
to django-...@googlegroups.com
#31597: New "Clear all filters" shown always in raw_id_fields popup
-------------------------------+--------------------------------------

Reporter: frnhr | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------------------------
Changes (by frnhr):

* Attachment "clearallfiltersrawidfields.jpg" added.

Django

unread,
May 16, 2020, 3:21:30 PM5/16/20
to django-...@googlegroups.com
#31597: New "Clear all filters" shown always in raw_id_fields popup
-------------------------------+--------------------------------------

Reporter: frnhr | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------------------------
Changes (by frnhr):

* Attachment "clearallfiltersrawidfields.jpg" added.


Django

unread,
May 16, 2020, 3:22:54 PM5/16/20
to django-...@googlegroups.com
#31597: New "Clear all filters" shown always in raw_id_fields popup
-------------------------------+--------------------------------------

Reporter: frnhr | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------------------------
Description changed by frnhr:

Old description:

> 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).
>
> [[Image(clearallfiltersrawidfields.png)]]

New description:

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).

[[Image(clearallfiltersrawidfields.jpg)]]

--

--
Ticket URL: <https://code.djangoproject.com/ticket/31597#comment:1>

Django

unread,
May 16, 2020, 3:58:27 PM5/16/20
to django-...@googlegroups.com
#31597: New "Clear all filters" shown always in raw_id_fields popup
-------------------------------+--------------------------------------
Reporter: frnhr | Owner: frnhr
Type: Uncategorized | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------------------------
Changes (by frnhr):

* owner: nobody => frnhr
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/31597#comment:2>

Django

unread,
May 18, 2020, 5:25:19 AM5/18/20
to django-...@googlegroups.com
#31597: "Clear all filters" link removes TO_FIELD_VAR and is always displayed in
raw_id_fields popup.
---------------------------------+------------------------------------
Reporter: frnhr | Owner: frnhr
Type: Bug | Status: assigned
Component: contrib.admin | Version: 3.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
---------------------------------+------------------------------------
Changes (by Hasan Ramezani):

* cc: Hasan Ramezani (removed)


--
Ticket URL: <https://code.djangoproject.com/ticket/31597#comment:5>

Django

unread,
May 19, 2020, 3:44:24 AM5/19/20
to django-...@googlegroups.com
#31597: "Clear all filters" link removes TO_FIELD_VAR and is always displayed in
raw_id_fields popup.
---------------------------------+------------------------------------
Reporter: frnhr | Owner: frnhr
Type: Bug | Status: assigned
Component: contrib.admin | Version: 3.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
---------------------------------+------------------------------------

Comment (by felixxm):

[https://github.com/django/django/pull/12934 New PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/31597#comment:6>

Django

unread,
May 20, 2020, 2:14:17 AM5/20/20
to django-...@googlegroups.com
#31597: "Clear all filters" link removes TO_FIELD_VAR and is always displayed in
raw_id_fields popup.
-------------------------------------+-------------------------------------

Reporter: frnhr | Owner: frnhr
Type: Bug | Status: assigned
Component: contrib.admin | Version: 3.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by felixxm):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/31597#comment:7>

Django

unread,
May 20, 2020, 3:34:18 PM5/20/20
to django-...@googlegroups.com
#31597: "Clear all filters" link removes TO_FIELD_VAR and is always displayed in
raw_id_fields popup.
-------------------------------------+-------------------------------------
Reporter: frnhr | Owner: frnhr
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.1
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"4484bc1b2f84da6442c9c2bfd95d3f1f7d8f96f7" 4484bc1b]:
{{{
#!CommitTicketReference repository=""
revision="4484bc1b2f84da6442c9c2bfd95d3f1f7d8f96f7"
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 <hasa...@gmail.com>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31597#comment:8>

Django

unread,
May 20, 2020, 3:36:06 PM5/20/20
to django-...@googlegroups.com
#31597: "Clear all filters" link removes TO_FIELD_VAR and is always displayed in
raw_id_fields popup.
-------------------------------------+-------------------------------------
Reporter: frnhr | Owner: frnhr
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.1
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"47e21d339f91502f414ee2776a72a137e1994072" 47e21d33]:
{{{
#!CommitTicketReference repository=""
revision="47e21d339f91502f414ee2776a72a137e1994072"
[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 <hasa...@gmail.com>

Backport of 4484bc1b2f84da6442c9c2bfd95d3f1f7d8f96f7 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31597#comment:9>

Reply all
Reply to author
Forward
0 new messages