Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0003135mantisbtbugtrackerpublic2004-02-29 07:17
Reporterjerwied Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.18.1 
Summary0003135: Changing Print-Options does not work
Description

Submitting changed options results in an error (text not found) and the refresh-page is wrong

Additional Information

Due to a typo in print_all_bug_options_submit, a non-existent text is selected ('operation_succesful' instead of 'operation_successful'). The refresh-page points to a non-existent page (for example http://mantis.calaquendi.net/0) because $f_redirect is wrong?

TagsNo tags attached.
Attached Files
3135.diff (1,371 bytes)   
Index: print_all_bug_options_inc.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/print_all_bug_options_inc.php,v
retrieving revision 1.19
diff -u -r1.19 print_all_bug_options_inc.php
--- print_all_bug_options_inc.php	11 Jan 2004 07:16:07 -0000	1.19
+++ print_all_bug_options_inc.php	16 Feb 2004 12:44:37 -0000
@@ -129,8 +129,7 @@
 <?php # display the checkboxes
 for ($i=0 ; $i <$field_name_count ; $i++) {
 
-	$row_color = $i%2+1;
-	PRINT "<tr class=\"row-($row_color)\">";
+	printf ( '<tr %s>', helper_alternate_class( $i ) );
 ?>
 
 	<td class="category">
Index: print_all_bug_options_update.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/print_all_bug_options_update.php,v
retrieving revision 1.14
diff -u -r1.14 print_all_bug_options_update.php
--- print_all_bug_options_update.php	11 Jan 2004 07:16:07 -0000	1.14
+++ print_all_bug_options_update.php	16 Feb 2004 12:44:37 -0000
@@ -30,7 +30,9 @@
 	# check the checkboxes
 	for ($i=0 ; $i <$field_name_count ; $i++) {
 		$t_name='print_'.strtolower(str_replace(' ','_',$t_field_name_arr[$i]));
-		if ( !isset( $$t_name ) || ( 1 == ($$t_name) ) ) {
+		$t_flag = gpc_get( $t_name, null );
+
+		if ( $t_flag === null ) {
 			$t_prefs_arr[$i] = 0;
 		}
 		else {
3135.diff (1,371 bytes)   

Relationships

has duplicate 0003201 closedint2str Printing Options 
has duplicate 0003560 closedvboctor Updating print options resets all fields to "off" with no way to set fields again 

Activities

jfitzell

jfitzell

2003-04-16 18:30

reporter   ~0004186

this seems like an easy fix, don't know why nobody has done it yet... I'll add a note to 0003067

jerwied

jerwied

2003-05-06 20:41

reporter   ~0004310

Last edited: 2003-05-06 20:51

Saving print-options does not work for three reasons: The options are not read from the _POST[]-array, the evaluation is (possibly) wrong and the UPDATE-statement uses the wrong variable for updates.

The changes:

Instead of '$$t_name', use '$_POST[$t_name]'
Remove the comparison '1 == $t_name'
Change '$t_user_id' to '$f_user_id' in the UPDATE-statement.

Context diff:

--- print_all_bug_options_update.php Tue May 6 22:46:27 2003
+++ print_all_bug_options_update.php.new Tue May 6 20:45:31 2003
@@ -25,7 +25,9 @@

# check the checkboxes

+
for ($i=0 ; $i <$field_name_count ; $i++) {
$tname='print'.strtolower(strreplace(' ','',$t_field_name_arr[$i]));

  • if ( !isset( $$t_name ) || ( 1 == ($$t_name) ) ) {
  • if ( !isset( $_POST[$t_name] ) ) {
    $t_prefs_arr[$i] = 0;
    }
    @@ -43,5 +45,5 @@
    $query = "UPDATE $g_mantis_user_print_pref_table
    SET print_pref='$c_export'
  • WHERE user_id='$t_user_id'";
  • WHERE user_id='$f_user_id'";

    $result = db_query( $query );

edited on: 05-06-03 20:51

idcmp

idcmp

2003-06-11 21:26

reporter   ~0004342

the $f_redirect_url is also wrong for that function. It needs to be changed from a gpc_get_int('redirect_url'); to a gpc_get_string('redirect_url');

jerwied

jerwied

2003-06-12 06:58

reporter   ~0004345

This is not true for the version from CVS, the redirect url was already fixed, but not the saving.

vboctor

vboctor

2004-02-16 07:51

manager   ~0005046

This bug used to apply when register_globals is set to OFF. Patch is now attached and fix committed to CVS. This patch will also fix the rotation of row-1/2 styles for the form itself (dark gray/light gray).