[search] Empty filter deletion is bugged #1698

Closed
opened 2026-10-05 00:53:21 +02:00 by adam · 2 comments
Owner

In the new multi-criteria search when you delete an empty filter and then go to the filter manager and validate the form, on the reload, the deleted filter is back in the filter list.

Reproduce the issue :

  • Open a filter and click 'Delete' action
  • Open the filter manager
  • Click validate

When the page reloads, the filter you deleted should be back.

A semi-fix to this issue is to change $("#addLinkedAlbum").has(e.target).length === 0 to $("#addLinkedAlbum").has(e.target).length !== 0 But it breaks the filter's closing when you click outside them.
For now we choose to keep it as it is because the path to reproduce is unlikely to happen and can be worked around if needed.

In the new multi-criteria search when you delete an empty filter and then go to the filter manager and validate the form, on the reload, the deleted filter is back in the filter list. Reproduce the issue : - Open a filter and click 'Delete' action - Open the filter manager - Click validate When the page reloads, the filter you deleted should be back. A semi-fix to this issue is to change ``` $("#addLinkedAlbum").has(e.target).length === 0 ``` to ``` $("#addLinkedAlbum").has(e.target).length !== 0 ``` But it breaks the filter's closing when you click outside them. For now we choose to keep it as it is because the path to reproduce is unlikely to happen and can be worked around if needed. <!-- github-sync-id:1818039228 -->
adam closed this issue 2026-10-05 00:53:21 +02:00
Author
Owner

A quick way to solve this would be to trigger the page reload even if the filter we delete is empty.

In mcs.js :
For earch filter .delete").on("click" listenner just change the performSearch() function's second param to true.
It will trigger the reload.

A quick way to solve this would be to trigger the page reload even if the filter we delete is empty. In ```mcs.js``` : For earch filter ```.delete").on("click"``` listenner just change the ```performSearch()``` function's second param to ```true```. It will trigger the reload. <!-- github-comment-id:1651433400 -->
Author
Owner
Bug fixed with the proposed workaround, see https://github.com/Piwigo/Piwigo/commit/f62d255e0ab689d8195bc7d19c16811b3f9560b3 <!-- github-comment-id:1661907413 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1698