View Issue Details

IDProjectCategoryView StatusLast Update
0009460mantisbtbugtrackerpublic2014-12-05 18:33
Reporterruss Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.1.2 
Target Version1.2.18Fixed in Version1.2.18 
Summary0009460: Default profile doesn't work
Description

Setting the default profile has no affect when reporting a bug. If a default profile is set for a user, that profile should be selected by default.

The code that gets the default profile checks if the selected profiles is an empty string. The code that calls the method, passes in 0 when the profile is expecting an empty string in this case.

See: print_api.php:608 - print_profile_option_list
See: print_api.php:622 - print_profile_option_list_for_project

I'd suggest checking for 0 in addition/replacement of empty string check based on callers.

TagsNo tags attached.

Activities

jtmayer

jtmayer

2011-09-15 05:12

reporter   ~0029725

I encountered the same issue. Do you plan to solve it?

poulpy55

poulpy55

2014-07-17 09:03

reporter   ~0040940

Last edited: 2014-08-08 04:56

Same thing on mantisbt 1.2.17
Mmmh after one day of searching I found a workaround (mmmh and now it seems to be the solution that will be adopted ? If it is, it was a pleasure to help the project but I'd like to had the confirmation that I found the precise problem and solution)

On line 298 on /bug_report_page.php, there is:
<?php print_profile_option_list( auth_get_current_user_id(), $f_profile_id ) ?>
If you modify to
<?php print_profile_option_list( auth_get_current_user_id(), profile_get_default(auth_get_current_user_id()) ) ?>
The default profile used will be the current user's default profile, instead of just current user's ID.

atrol

atrol

2014-08-08 08:05

developer   ~0041034

but I'd like to had the confirmation that I found the precise problem and solution

I didn't have a deeper look, but your proposed change is quite different from what dregad changed

https://github.com/mantisbt/mantisbt/commit/6baf7650fe321a149302c64682f94dbdb2b51b3a

dregad

dregad

2014-08-08 16:53

developer   ~0041036

poulpy55, your workaround was not addressing the root cause of the problem. The correct solution was actually outlined by russ in the original issue description.

Anyway, your bumping the issue made me look at it and implement the fix, so you did contribute to the project - even indirectly - so thanks anyway.

dregad

dregad

2014-08-08 16:54

developer   ~0041037

Backported to 1.2.x

Related Changesets

MantisBT: master 6baf7650

2014-07-24 14:59

dregad


Details Diff
Set profile to user's default when reporting issues

The default profile was not picked up before this, because the caller
(bug_report_page.php) actually sent '0' as profile id to select, while
the print functions did a strict check for ''.

Fixes 0009460
Affected Issues
0009460
mod - core/print_api.php Diff File

MantisBT: master-1.2.x ea27796c

2014-07-24 14:59

dregad


Details Diff
Set profile to user's default when reporting issues

The default profile was not picked up before this, because the caller
(bug_report_page.php) actually sent '0' as profile id to select, while
the print functions did a strict check for ''.

Fixes 0009460

Backport from master 6baf7650fe321a149302c64682f94dbdb2b51b3a
Affected Issues
0009460
mod - core/print_api.php Diff File