View Issue Details

IDProjectCategoryView StatusLast Update
0009676mantisbtadministrationpublic2009-01-15 11:25
Reporterkarotos Assigned Tojreese  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0a2 
Fixed in Version1.2.0a3 
Summary0009676: The "Inherit Global Categories" checkbox does not work when creating a new project
Description

The status of the "inherit_global" checkbox is ignored when creating a new project. (it is always being created with inherit_global flag set to true)

fixed locally by changing
$f_inherit_global = gpc_get_bool( 'inherit_global', 1 );
to
$f_inherit_global = gpc_get_bool( 'inherit_global');
In file: manage_proj_create.php, line 43

Steps To Reproduce
  1. Log in as administrator
  2. Browse to Manage->Manage Projects->Create New Project
  3. provide a name for the project
  4. uncheck the checkbox "Inherit Global Categories"
  5. submit the Form

Check
check the newly created project's status
(from the mantis database table "mantis_project_table" or using the Edit Project page)

Actual result
The inherit_global flag is true

Expected result
The inherit_global flag should be false

Additional Information

The bug also exists in latest svn trunk (revision 5632)

TagsNo tags attached.

Activities

jreese

jreese

2008-10-07 08:54

reporter   ~0019503

Fixed in SVN trunk, r5633. Thanks for catching this.

karotos

karotos

2008-10-07 09:49

reporter   ~0019504

OK, checked in latest trunk and it seems fixed.

Just for me to understand: why did you set the zero value?
The function "gpc_get_bool" defaults the second argument to false anyway!

$f_inherit_global = gpc_get_bool( 'inherit_global', 0 );
$f_inherit_global = gpc_get_bool( 'inherit_global');
It seems to be unnecessary.

I saw that you also changed tha line under it?
Did it have the same effect to the creation of a subproject?

jreese

jreese

2008-10-07 10:09

reporter   ~0019506

Without the default value of 0, gpc_get_bool() will fail because unchecked input checkboxes result in no form parameter sent to the server, and the call to gpc_get_bool() then errors out saying "required input not entered" or whatever the error message is. It's necessary only for checkboxes just because of the way the HTTP/HTML spec works and how our GPC API works.

As for the other line, yes, it was a bug just the same as what you submitted.

Related Changesets

MantisBT: master aa928c13

2008-10-07 08:53

jreese


Details Diff
Fix 0009676: Bad default values for category bools when creating projects.

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@5633 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0009676
mod - manage_proj_create.php Diff File