View Issue Details

IDProjectCategoryView StatusLast Update
0004200mantisbtrelationshipspublic2012-08-22 18:33
Reportervboctor Assigned Tomasc  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.19.0a2 
Summary0004200: Create Child should use Report Page
Description

Currently create child option makes a copy of the current issue, then opens it in update mode to allow for doing the editing to allow the user to set the information about the child task.

I think this is a hack that should be replaced by opening the report page while posting to it the information from the current issue. This way the report page will be opened with the appropriate values, then the user can edit and submit or just cancel by going back or clicking on the menu.

The main reason I also don't like the current approach, is that the changes done by the "Update" are logged in the history which is confusing to users.

Also during the period where the user is updating the inforamtion of the child bug, other users using Mantis will see the issue as a duplicate of the parent issue and may just resolve it as duplicate of the original parent issue (although they may see the relationship).

I think this issue should be fixed for 0.19.0rc1.

TagsNo tags attached.
Attached Files
patch_4200.zip (24,510 bytes)
patch.diff.4200.txt (11,313 bytes)   
Common subdirectories: ./CVS and ../mantisbt/CVS
Common subdirectories: ./admin and ../mantisbt/admin
Only in ../mantisbt: bug_create_child.php
diff ./bug_report.php ../mantisbt/bug_report.php
11c11,12
< 
---
> ?>
> <?php
13c14,15
< 
---
> ?>
> <?php
15c17
< 
---
> 	
17c19
< 
---
> 	
22c24,25
< 
---
> ?>
> <?php
120,139d122
< 	}
< 
< 	$f_master_bug_id = gpc_get_int( 'm_id', 0 );
< 
< 	if( $f_master_bug_id > 0 ) {
< 		# it's a child generation... let's create the relationship and add some lines in the history
< 
< 		# Add log line to record the cloning action
< 		history_log_event_special( $t_bug_id, BUG_CREATED_FROM, '', $f_master_bug_id );
< 		history_log_event_special( $f_master_bug_id, BUG_CLONED_TO, '', $t_bug_id );
< 
< 		# Add relation
< 		relationship_add( $f_master_bug_id, $t_bug_id, BUG_DEPENDANT );
< 
< 		# Add log line to the history (both bugs)
< 		history_log_event_special( $f_master_bug_id, BUG_ADD_RELATIONSHIP, BUG_DEPENDANT, $t_bug_id );
< 		history_log_event_special( $t_bug_id, BUG_ADD_RELATIONSHIP, BUG_BLOCKS, $f_master_bug_id );
< 
< 		# send email notification to the users addressed by the master bug
< 		email_relationship_added( $f_master_bug_id );
diff ./bug_report_advanced_page.php ../mantisbt/bug_report_advanced_page.php
11c11,12
< 
---
> ?>
> <?php
13c14,15
< 
---
> ?>
> <?php
20c22,23
< 
---
> ?>
> <?php
32,97c35,51
< 	$f_master_bug_id = gpc_get_int( 'm_id', 0 );
< 
< 	if( $f_master_bug_id > 0 ) {
< 		# master bug exists...
< 		bug_ensure_exists( $f_master_bug_id );
< 
< 		# master bug is not read-only...
< 		if ( bug_is_readonly( $f_master_bug_id ) ) {
< 			error_parameters( $f_master_bug_id );
< 			trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR );
< 		}
< 
< 		# the user can at least update the master bug (needed to add the relationship)...
< 		access_ensure_bug_level( config_get( 'update_bug_threshold' ), $f_master_bug_id );
< 
< 		$t_bug = bug_prepare_display( bug_get( $f_master_bug_id, true ) );
< 
< 		$f_build				= $t_bug->build;
< 		$f_platform				= $t_bug->platform;
< 		$f_os					= $t_bug->os;
< 		$f_os_build				= $t_bug->os_build;
< 		$f_product_version		= $t_bug->version;
< 		$f_profile_id			= 0;
< 		$f_handler_id			= $t_bug->handler_id;
< 
< 		$f_category				= $t_bug->category;
< 		$f_reproducibility		= $t_bug->reproducibility;
< 		$f_severity				= $t_bug->severity;
< 		$f_priority				= $t_bug->priority;
< 		$f_summary				= $t_bug->summary;
< 		$f_description			= $t_bug->description;
< 		$f_steps_to_reproduce	= $t_bug->steps_to_reproduce;
< 		$f_additional_info		= $t_bug->additional_information;
< 		$f_view_state			= $t_bug->view_state;
< 
< 		$t_project_id			= $t_bug->project_id;
< 
< 		if( $t_project_id != helper_get_current_project() ) {
< 			# in case the current project is not the same project of the bug we are cloning...
< 			# ...se set on fly the current project. This to avoid problems with categories and handlers lists etc.
< 			$t_redirect_url = "set_project.php?project_id=" . $t_project_id .
< 				"&make_default=no&ref=" . urlencode( "bug_report_advanced_page.php?m_id=" . $f_master_bug_id );
< 			print_header_redirect( $t_redirect_url );
< 		}
< 	}
< 	else {
< 		$f_build				= gpc_get_string( 'build', '' );
< 		$f_platform				= gpc_get_string( 'platform', '' );
< 		$f_os					= gpc_get_string( 'os', '' );
< 		$f_os_build				= gpc_get_string( 'os_build', '' );
< 		$f_product_version		= gpc_get_string( 'product_version', '' );
< 		$f_profile_id			= gpc_get_int( 'profile_id', 0 );
< 		$f_handler_id			= gpc_get_int( 'handler_id', 0 );
< 
< 		$f_category				= gpc_get_string( 'category', '' );
< 		$f_reproducibility		= gpc_get_int( 'reproducibility', 0 );
< 		$f_severity				= gpc_get_int( 'severity', config_get( 'default_bug_severity' ) );
< 		$f_priority				= gpc_get_int( 'priority', config_get( 'default_bug_priority' ) );
< 		$f_summary				= gpc_get_string( 'summary', '' );
< 		$f_description			= gpc_get_string( 'description', '' );
< 		$f_steps_to_reproduce	= gpc_get_string( 'steps_to_reproduce', '' );
< 		$f_additional_info		= gpc_get_string( 'additional_info', '' );
< 		$f_view_state			= gpc_get_int( 'view_state', config_get( 'default_bug_view_status' ) );
< 
< 		$t_project_id			= helper_get_current_project();
< 	}
---
> 	$f_build				= gpc_get_string( 'build', '' );
> 	$f_platform				= gpc_get_string( 'platform', '' );
> 	$f_os					= gpc_get_string( 'os', '' );
> 	$f_os_build				= gpc_get_string( 'os_build', '' );
> 	$f_product_version		= gpc_get_string( 'product_version', '' );
> 	$f_profile_id			= gpc_get_int( 'profile_id', 0 );
> 	$f_handler_id			= gpc_get_int( 'handler_id', 0 );
> 
> 	$f_category				= gpc_get_string( 'category', '' );
> 	$f_reproducibility		= gpc_get_int( 'reproducibility', 0 );
> 	$f_severity				= gpc_get_int( 'severity', config_get( 'default_bug_severity' ) );
> 	$f_priority				= gpc_get_int( 'priority', config_get( 'default_bug_priority' ) );
> 	$f_summary				= gpc_get_string( 'summary', '' );
> 	$f_description			= gpc_get_string( 'description', '' );
> 	$f_steps_to_reproduce	= gpc_get_string( 'steps_to_reproduce', '' );
> 	$f_additional_info		= gpc_get_string( 'additional_info', '' );
> 	$f_view_state			= gpc_get_int( 'view_state', config_get( 'default_bug_view_status' ) );
101,102c55
< 	html_page_top1( lang_get( 'report_bug_link' ) );
< 	html_page_top2();
---
> 	$t_project_id			= helper_get_current_project();
103a57,58
> <?php html_page_top1( lang_get( 'report_bug_link' ) ) ?>
> <?php html_page_top2() ?>
114d68
< 		<input type="hidden" name="m_id" value="<?php echo $f_master_bug_id ?>" />
121,122c75
< 				print_bracket_link( 'bug_report_page.php' .
< 					( $f_master_bug_id > 0 ? '?m_id=' . $f_master_bug_id : '' ), lang_get( 'simple_report_link' ) );
---
> 				print_bracket_link( 'bug_report_page.php', lang_get( 'simple_report_link' ) );
249,250c202,203
< 	$t_show_version = ( ON == config_get( 'show_product_version' ) )
< 			|| ( ( AUTO == config_get( 'show_product_version' ) )
---
> 	$t_show_version = ( ON == config_get( 'show_product_version' ) ) 
> 			|| ( ( AUTO == config_get( 'show_product_version' ) ) 
252c205
< 	if ( $t_show_version ) {
---
> 	if ( $t_show_version ) { 
266c219
< 	}
---
> 	} 
363c316
< 			$t_custom_fields_found = true;
---
> 			$t_custom_fields_found = true;			
370c323
< 		<?php print_custom_field_input( $t_def, $f_master_bug_id ) ?>
---
> 		<?php print_custom_field_input( $t_def ) ?>
diff ./bug_report_page.php ../mantisbt/bug_report_page.php
11c11,12
< 
---
> ?>
> <?php
13c14,15
< 
---
> ?>
> <?php
20c22,23
< 
---
> ?>
> <?php
32,81c35,43
< 	$f_master_bug_id = gpc_get_int( 'm_id', 0 );
< 
< 	if( $f_master_bug_id > 0 ) {
< 		# master bug exists...
< 		bug_ensure_exists( $f_master_bug_id );
< 
< 		# master bug is not read-only...
< 		if ( bug_is_readonly( $f_master_bug_id ) ) {
< 			error_parameters( $f_master_bug_id );
< 			trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR );
< 		}
< 
< 		# the user can at least update the master bug (needed to add the relationship)...
< 		access_ensure_bug_level( config_get( 'update_bug_threshold' ), $f_master_bug_id );
< 
< 		$t_bug = bug_prepare_display( bug_get( $f_master_bug_id, true ) );
< 
< 		$f_product_version		= $t_bug->version;
< 		$f_category				= $t_bug->category;
< 		$f_reproducibility		= $t_bug->reproducibility;
< 		$f_severity				= $t_bug->severity;
< 		$f_priority				= $t_bug->priority;
< 		$f_summary				= $t_bug->summary;
< 		$f_description			= $t_bug->description;
< 		$f_additional_info		= $t_bug->additional_information;
< 		$f_view_state			= $t_bug->view_state;
< 
< 		$t_project_id			= $t_bug->project_id;
< 
< 		if( $t_project_id != helper_get_current_project() ) {
< 			# in case the current project is not the same project of the bug we are cloning...
< 			# ...se set on fly the current project. This to avoid problems with categories and handlers lists etc.
< 			$t_redirect_url = "set_project.php?project_id=" . $t_project_id .
< 				"&make_default=no&ref=" . urlencode( "bug_report_page.php?m_id=" . $f_master_bug_id );
< 			print_header_redirect( $t_redirect_url );
< 		}
< 	}
< 	else {
< 		$f_product_version		= gpc_get_string( 'product_version', '' );
< 		$f_category				= gpc_get_string( 'category', '' );
< 		$f_reproducibility		= gpc_get_int( 'reproducibility', 0 );
< 		$f_severity				= gpc_get_int( 'severity', config_get( 'default_bug_severity' ) );
< 		$f_priority				= gpc_get_int( 'priority', config_get( 'default_bug_priority' ) );
< 		$f_summary				= gpc_get_string( 'summary', '' );
< 		$f_description			= gpc_get_string( 'description', '' );
< 		$f_additional_info		= gpc_get_string( 'additional_info', '' );
< 		$f_view_state			= gpc_get_int( 'view_state', config_get( 'default_bug_view_status' ) );
< 
< 		$t_project_id			= helper_get_current_project();
< 	}
---
> 	$f_product_version		= gpc_get_string( 'product_version', '' );
> 	$f_category				= gpc_get_string( 'category', '' );
> 	$f_reproducibility		= gpc_get_int( 'reproducibility', 0 );
> 	$f_severity				= gpc_get_int( 'severity', config_get( 'default_bug_severity' ) );
> 	$f_priority				= gpc_get_int( 'priority', config_get( 'default_bug_priority' ) );
> 	$f_summary				= gpc_get_string( 'summary', '' );
> 	$f_description			= gpc_get_string( 'description', '' );
> 	$f_additional_info		= gpc_get_string( 'additional_info', '' );
> 	$f_view_state			= gpc_get_int( 'view_state', config_get( 'default_bug_view_status' ) );
85,86c47
< 	html_page_top1( lang_get( 'report_bug_link' ) );
< 	html_page_top2();
---
> 	$t_project_id			= helper_get_current_project();
87a49,50
> <?php html_page_top1( lang_get( 'report_bug_link' ) ) ?>
> <?php html_page_top2() ?>
98d60
< 		<input type="hidden" name="m_id" value="<?php echo $f_master_bug_id ?>" />
106,107c68
< 				print_bracket_link( 'bug_report_advanced_page.php' .
< 					( $f_master_bug_id > 0 ? '?m_id=' . $f_master_bug_id : '' ), lang_get( 'advanced_report_link' ) );
---
> 				print_bracket_link( 'bug_report_advanced_page.php', lang_get( 'advanced_report_link' ) );
174,175c135,136
< 	$t_show_version = ( ON == config_get( 'show_product_version' ) )
< 			|| ( ( AUTO == config_get( 'show_product_version' ) )
---
> 	$t_show_version = ( ON == config_get( 'show_product_version' ) ) 
> 			|| ( ( AUTO == config_get( 'show_product_version' ) ) 
177c138
< 	if ( $t_show_version ) {
---
> 	if ( $t_show_version ) { 
191c152
< 	}
---
> 	} 
256c217
< 		<?php print_custom_field_input( $t_def, $f_master_bug_id ) ?>
---
> 		<?php print_custom_field_input( $t_def ) ?>
Common subdirectories: ./core and ../mantisbt/core
Common subdirectories: ./css and ../mantisbt/css
Common subdirectories: ./doc and ../mantisbt/doc
Common subdirectories: ./graphs and ../mantisbt/graphs
Common subdirectories: ./images and ../mantisbt/images
Common subdirectories: ./javascript and ../mantisbt/javascript
Common subdirectories: ./lang and ../mantisbt/lang
Common subdirectories: ./packages and ../mantisbt/packages
Only in .: patch.diff.txt
Common subdirectories: ./sql and ../mantisbt/sql
patch.diff.4200.txt (11,313 bytes)   

Relationships

has duplicate 0004333 closedthraxisp Email on child creation 
related to 0013816 closeddregad Enhance history when copying issues 

Activities

vboctor

vboctor

2004-07-29 22:43

manager   ~0006469

In my opinion, if this change is a lot of effort, then we should drop the "Create Child" feature from 0.19.0.

vboctor

vboctor

2004-08-01 03:58

manager   ~0006519

I disabled the "Create Child" feature from CVS. Hence, this issue feature is now dropped from the list of issues that must be done for 0.19.0rc1. However, it would be nice if it is ready for 0.19.0rc1.

masc

masc

2004-08-01 09:16

reporter   ~0006525

Victor,
as soon as I will complete the new login/password managing, I will implement the create child as you requests

vboctor

vboctor

2004-08-01 09:23

manager   ~0006527

Thanks Marcello. I hope we can get the login work into 0.19.0rc1 then.

masc

masc

2004-08-05 05:08

reporter   ~0006650

Victor,
find attached the patch to solve this bug.
Now, by pressing the 'create child' button, you a redirected to the bug_report page (or advance) where all the fields are pre-compiled with the data of the 'parent' bug.
When the user submits the child bug, I created the relationship between them and set the history.

In the patch it's included a small modification in the history_api to show in the history not only the related bug number but also the relationship type description.

The bug_create_child.php page can be removed.

jlatour

jlatour

2004-08-06 09:37

reporter   ~0006694

I had trouble applying this patch, and even more trouble reading it. Could you submit a unified diff, preferably using 'cvs diff -u' ?

Thanks.

thraxisp

thraxisp

2004-08-17 13:55

reporter   ~0007033

This change has been committed to CVS.

Related Changesets

MantisBT: master 88fdff95

2004-08-01 04:56

vboctor


Details Diff
Disabled the "Create Child" feature until the implementation is modified (see issue 4200 for more details).

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