Skip to content

Commit

Permalink
user_pref_get should be used outside of userpref api. By default if p…
Browse files Browse the repository at this point in the history
…refreneces do not exist, a new object is returned.
  • Loading branch information
mantis committed May 17, 2009
1 parent 2ef2f58 commit 52102cd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions core/helper_api.php
Expand Up @@ -169,12 +169,8 @@ function helper_get_current_project() {
$t_project_id = gpc_get_cookie( $t_cookie_name, null );

if( null === $t_project_id ) {
$t_pref_row = user_pref_cache_row( auth_get_current_user_id(), ALL_PROJECTS, false );
if( false === $t_pref_row ) {
$t_project_id = ALL_PROJECTS;
} else {
$t_project_id = $t_pref_row['default_project'];
}
$t_pref = user_pref_get( auth_get_current_user_id(), ALL_PROJECTS, false );
$t_project_id = $t_pref->default_project;
} else {
$t_project_id = split( ';', $t_project_id );
$t_project_id = $t_project_id[count( $t_project_id ) - 1];
Expand Down

0 comments on commit 52102cd

Please sign in to comment.