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.
* Attachment "clearallfiltersrawidfields.jpg" added.
* Attachment "clearallfiltersrawidfields.jpg" added.
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>
* owner: nobody => frnhr
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/31597#comment:2>
* cc: Hasan Ramezani (removed)
--
Ticket URL: <https://code.djangoproject.com/ticket/31597#comment:5>
Comment (by felixxm):
[https://github.com/django/django/pull/12934 New PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/31597#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/31597#comment:7>
* 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>
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>