View Issue Details

IDProjectCategoryView StatusLast Update
0027144mantisbtcode cleanuppublic2021-10-26 17:32
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version2.25.0Fixed in Version2.25.0 
Summary0027144: Data integrity: ensure users' default_project preference is a valid project
Description

Currently, it is possible for a user's default project setting (user_pref_table.default_project) to contain an invalid project id.

This can happen when the user is removed from the list of allowed users on a private project, or when a project becomes private or is deleted.

While this does not have direct consequences in the MantisBT UI because it transparently copes with it, in terms of data integrity this should not happen.

Additional Information

The issue was identified while reviewing the patch for 0026988 - see https://github.com/mantisbt/mantisbt/pull/1677#issuecomment-637686480

TagsNo tags attached.

Relationships

related to 0026988 closeddregad issue report TOO_MANY_REDIRECTS 
related to 0028120 closeddregad Improve performance of user_pref_clear_invalid_project_default() 
related to 0029222 closeddregad Removing user/project assigments kills default project in account preferences 

Activities

Related Changesets

MantisBT: master 5acff67b

2020-08-07 15:26

dregad


Details Diff
New User Pref API functions to clear project_default

Issue 0027144
Affected Issues
0027144
mod - core/user_pref_api.php Diff File

MantisBT: master 6023c6bc

2020-08-07 15:49

dregad


Details Diff
Ensure default_project pref is a valid project

It was possible for a user's default project setting to contain an
invalid project id (user_pref_table.default_project). This can happen
when the user is removed from the list of allowed users on a private
project, or when a project becomes private or is deleted. While this
does not impact the MantisBT UI which transparently copes with it, in
terms of data integrity this should not happen.

We now set default_project to ALL_PROJECTS (0) when users no longer have
access to their default project.

Fixes 0027144
Affected Issues
0027144
mod - core/project_api.php Diff File