View Issue Details

IDProjectCategoryView StatusLast Update
0037004mantisbtfilterspublic2026-04-10 21:03
Reportervboctor Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.28.0 
Target Version2.29.0Fixed in Version2.29.0 
Summary0037004: Deleting a user doesn't delete their filters
Description

When a user is deleted, their filters should be deleted too.

TagsNo tags attached.

Activities

vboctor

vboctor

2026-04-04 06:04

manager   ~0070938

PR: https://github.com/mantisbt/mantisbt/pull/2200

dregad

dregad

2026-04-06 08:19

developer   ~0070941

Deleting all of a user's personal filters is absolutely fine.

I have some concerns about doing the same with global filters though. I believe those should be kept.

vboctor

vboctor

2026-04-06 10:33

manager   ~0070944

I was thinking about the same thing but I decided not to at the end.

  1. Ideally users should be disabled in the regular case and not deleted.
  2. If we keep the shared filters of the user, I’m not sure we will be able to manage the filter (eg delete it or update it).
atrol

atrol

2026-04-06 10:55

developer   ~0070945

Last edited: 2026-04-06 10:55

I’m not sure we will be able to manage the filter (eg delete it or update it).

@vboctor having stored_query_create_shared_threshold access rights (default MANAGER) is enough for that.
Changing the owner is currently not possible.

dregad

dregad

2026-04-07 03:53

developer   ~0070946

having stored_query_create_shared_threshold access rights (default MANAGER) is enough for that.

Exactly.

I my opinion, it would be best not to delete shared filters. They can always be removed manually later on by an authorized user.

atrol

atrol

2026-04-09 12:37

developer   ~0070954

@vboctor what about adding an entry to schema.php / $g_upgrade to delete filters where the owner does no longer exist?

Related Changesets

MantisBT: master bf3b3641

2026-04-04 06:02

vboctor

Committer: dregad


Details Diff
Deleting a user now deletes its filters

Fixes 0037004
Affected Issues
0037004
mod - core/filter_api.php Diff File
mod - core/user_api.php Diff File

MantisBT: master 609a4ab3

2026-04-09 20:26

vboctor

Committer: dregad


Details Diff
Delete only private filters when a user is deleted.

Fixes 0037004
Affected Issues
0037004
mod - core/filter_api.php Diff File

MantisBT: master 9f205fe8

2026-04-09 20:27

vboctor

Committer: dregad


Details Diff
Add delete filters when a user is deleted test cases

Fixes 0037004
Affected Issues
0037004
add - tests/Mantis/FilterApiTest.php Diff File

MantisBT: master 1fb42f9f

2026-04-09 20:37

vboctor

Committer: dregad


Details Diff
Added a schema upgrade step to delete ophaned private filters

Fixes 0037004
Affected Issues
0037004
mod - admin/schema.php Diff File
mod - core/install_helper_functions_api.php Diff File

MantisBT: master 739dcd1d

2026-04-10 20:35

dregad


Details Diff
Replace deprecated db_prepare_bool() by query param

This fixes the invalid query generated for pgsql.

Fixes 0037004
Affected Issues
0037004
mod - core/install_helper_functions_api.php Diff File