View Issue Details

IDProjectCategoryView StatusLast Update
0037523mantisbtadministrationpublic2026-12-03 09:00
Reporterdombn Assigned Tocommunity  
PrioritynormalSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Product Version2.26.0 
Target Version2.29.1 
Summary0037523: Deleting any project resets the current project selection to All Projects
Description

After deleting a project via Manage Projects, the user's current project is always reset to All Projects, even if a different project was selected.

manage_proj_delete.php only intends to reset the selection when the deleted project is the current one (fix for 0002808):

if( helper_get_current_project() == $f_project_id ) {
    helper_set_current_project( ALL_PROJECTS );
}

Since 76852a513 (released in 2.26.0), ProjectDeleteCommand::process() sets $g_project_override to the deleted project and does not restore it. helper_get_current_project() returns the override instead of the cookie value, so the check is always true.

Steps To Reproduce
  1. Create an empty project, then select another project (A) as current project.
  2. Delete the empty project via Manage Projects → Delete Project and confirm.
  3. Reload My View: the project selector shows All Projects instead of A.
Additional Information

Found while discussing project override handling in commands in https://github.com/mantisbt/mantisbt/pull/2317 (related: 0037512). Possible fixes: restore the previous override in ProjectDeleteCommand after processing, or compare against the cookie value in manage_proj_delete.php. I'm happy to provide a PR.

TagsNo tags attached.

Relationships

related to 0037512 acknowledgedcommunity Category commands set the project cookie on every call (one Set-Cookie per project in GET /api/rest/projects) 
related to 0037524 assignedcommunity Commands leak $g_project_override after execute() — add opt-in save/restore in Command 

Activities

There are no notes attached to this issue.