View Issue Details

IDProjectCategoryView StatusLast Update
0013775mantisbtbugtrackerpublic2012-02-21 11:11
Reportervincent_sels Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Product Version1.2.9 
Summary0013775: print_version_option_list() causes error when called for all projects
Description

When the list of project versions is printed when 'All projects' is selected, an error occurs:

APPLICATION ERROR 1601 - Version "" not found.

it fetches all versions with project_id = 0 which is of course nothing

Steps To Reproduce

==> Error occurs

Call stack
core/version_api.php 102 - - trigger_error ( <string>'1601', <integer>256 )
core/print_api.php 769 - - version_cache_row ( <boolean>false )
plugins/ProjectManagement/pages/resource_allocation_page.php 143 - - print_version_option_list ( <string>'1', <NULL>NULL, <integer>0, <boolean>false, <boolean>true )
plugin.php 52 - - include ( <string>'plugins/ProjectManagement/pages/resource_allocation_page.php' )

Additional Information

See vincent_sels' original report for this issue in the Github discussion on commit fixing 0013096
https://github.com/mantisbt/mantisbt/commit/0ffb20f8807fc600750690e201ebf5fb325e7bfc

TagsNo tags attached.

Relationships

related to 0013935 closeddregad Version based filtering not possible 

Activities

dregad

dregad

2012-01-19 06:50

developer   ~0030940

vincent_sels suggests to change the code as follows:


diff --git a/core/version_api.php b/core/version_api.php
index c716510..b91aea0 100644
--- a/core/version_api.php
+++ b/core/version_api.php
@@ -653,7 +653,7 @@ function version_should_show_product_version( $p_project_id ) {
*/
function version_get_project_where_clause( $p_project_id, $p_inherit ) {
if ( $p_project_id == ALL_PROJECTS ) {

  • $t_inherit = false;
  • return helper_project_specific_where( ALL_PROJECTS );
    } else {
    if ( $p_inherit === null ) {
    $t_inherit = ( ON == config_get( 'subprojects_inherit_versions' ) );

helper_project_specific_where() prepares a where clause with all the projects accessible by the user, which he feels is the desired behavior in this situation.

dregad

dregad

2012-01-19 06:51

developer   ~0030941

Need to check carefully if this would cause any regression, anywhere version_get_project_where_clause() is used.