View Issue Details

IDProjectCategoryView StatusLast Update
0011812mantisbtadministrationpublic2010-04-23 14:31
Reporterstappel Assigned Tojreese  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0 
Fixed in Version1.2.1 
Summary0011812: Manage configuration page displays wrong error message
Description

If you have a project_id in the table mantis_config_table of a project which does no longer exists the manage configuration page will show the following error:
project "0" does not exist. This is wrong. I my case it was project number 20.

in core/project_api.php line 102:
trigger_error( ERROR_PROJECT_NOT_FOUND, ERROR );
is called, with a %d in the defined in:
lang/strings_english.txt: $MANTIS_ERROR[ERROR_PROJECT_NOT_FOUND] = 'Project "%1$d" not found.';

but the $g_error_parameters is not set before the line 102, so the project number is always wrong.

So maybe add the lines:
global $g_error_parameters;
$g_error_parameters = array((int) $p_project_id);

before line 102 in core/project_api.php

Additional Information

also maybe the page is to strict. the error blocks the whole page, you cannot go to the wrong line and press the delete button.

So maybe change the file: adm_config_report.php (line 167) from
<?php echo string_display_line( project_get_name( $v_project_id ) ) ?>

to:
<?php
if (project_exists( $v_project_id )) {
echo string_display_line( project_get_name( $v_project_id ) );
} else {
echo string_display_line( 'Unknown project: ' . $v_project_id );
}
?>

so it is possible to delete the invalid config line.

TagsNo tags attached.

Relationships

related to 0011813 closedjreese Project '0' not found when viewing bugs for all projects - no bugs shown 

Activities

jreese

jreese

2010-04-19 10:50

reporter   ~0025153

Fix committed to 1.2.x and master branches.

Related Changesets

MantisBT: master-1.2.x e249d237

2010-04-19 10:43

jreese


Details Diff
Fix 0011812: Unknown project errors

This fix updates the project_api to allow project_get_name to pass the
trigger_errors parameter up to project_cache_row, so that pages like
configuration report won't stop working if there is one bad row. This
also fixes the error triggered by project_cache_row so that it sets the
project ID string parameter before triggering the error.
Affected Issues
0011812
mod - core/project_api.php Diff File
mod - adm_config_report.php Diff File

MantisBT: master 956fe6bf

2010-04-19 10:43

jreese


Details Diff
Fix 0011812: Unknown project errors

This fix updates the project_api to allow project_get_name to pass the
trigger_errors parameter up to project_cache_row, so that pages like
configuration report won't stop working if there is one bad row. This
also fixes the error triggered by project_cache_row so that it sets the
project ID string parameter before triggering the error.
Affected Issues
0011812
mod - core/project_api.php Diff File
mod - adm_config_report.php Diff File

MantisBT: master-1.2.x de11008f

2010-04-19 10:49

jreese


Details Diff
Issue 0011812: Missed adding an API param Affected Issues
0011812
mod - core/project_api.php Diff File

MantisBT: master 4ec992b0

2010-04-19 10:49

jreese


Details Diff
Issue 0011812: Missed adding an API param Affected Issues
0011812
mod - core/project_api.php Diff File