Skip to content
Browse files

Fix #12259: select user's default project when it's a subproject

Function helper_get_current_project_trace did not properly build the project
hierarchy when initializing the array from the user's preferences

Signed-off-by: David Hicks <d@hx.id.au>
  • Loading branch information...
1 parent 344e440 commit 332233868199e4a5b3db7bf6e7c7ce1eebbca8c8 @dregad dregad committed with davidhicks Jun 23, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 core/helper_api.php
View
10 core/helper_api.php
@@ -340,9 +340,19 @@ function helper_get_current_project_trace() {
if( null === $t_project_id ) {
$t_bottom = current_user_get_pref( 'default_project' );
+ $t_parent = $t_bottom;
$t_project_id = Array(
$t_bottom,
);
+
+ while( true ) {
+ $t_parent = project_hierarchy_get_parent( $t_parent );
+ if( 0 == $t_parent ) {
+ break;
+ }
+ array_unshift($t_project_id, $t_parent);
+ }
+
} else {
$t_project_id = explode( ';', $t_project_id );
$t_bottom = $t_project_id[count( $t_project_id ) - 1];

0 comments on commit 3322338

Please sign in to comment.
Something went wrong with that request. Please try again.