View Issue Details

IDProjectCategoryView StatusLast Update
0007633mantisbtbugtrackerpublic2014-09-23 18:05
Reporterrobocoder Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.0.6 
Target Version1.2.11Fixed in Version1.2.11 
Summary0007633: Saving an edited note should touch bug's last_updated timestamp
Description

Technically, this is an update.

TagsNo tags attached.
Attached Files
bugnote_api.php.diff (1,219 bytes)   
--- mantisbt-1.2.8/core/bugnote_api.php	2011-09-06 15:23:10.000000000 +0100
+++ mantis/core/bugnote_api.php	2012-04-24 11:20:37.794674092 +0100
@@ -484,7 +484,7 @@
  * @return bool
  * @access public
  */
-function bugnote_date_update( $p_bugnote_id ) {
+function bugnote_date_update( $p_bugnote_id, $p_bug_update=false ) {
 	$c_bugnote_id = db_prepare_int( $p_bugnote_id );
 	$t_bugnote_table = db_get_table( 'mantis_bugnote_table' );
 
@@ -493,6 +493,16 @@
 					WHERE id=" . db_param();
 	db_query_bound( $query, Array( db_now(), $c_bugnote_id ) );
 
+	if ( $p_bug_update ) {
+		$t_bug_id = bugnote_get_field( $p_bugnote_id, 'bug_id' );
+		$t_bug_table = db_get_table( 'mantis_bug_table' );
+
+		$query = "UPDATE $t_bug_table
+					SET last_updated=" . db_param() ."
+					WHERE id=" . db_param();
+		db_query_bound( $query, Array( db_now(), $t_bug_id ) );
+	}
+
 	# db_query errors if there was a problem so:
 	return true;
 }
@@ -527,7 +537,7 @@
 	db_query_bound( $query, Array( $p_bugnote_text, $t_bugnote_text_id ) );
 
 	# updated the last_updated date
-	bugnote_date_update( $p_bugnote_id );
+	bugnote_date_update( $p_bugnote_id, true );
 
 	# insert a new revision
 	$t_user_id = auth_get_current_user_id();

bugnote_api.php.diff (1,219 bytes)   

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
has duplicate 0014181 closedatrol "Last Updated" field not updated on note edit 

Activities

PantsManUK

PantsManUK

2012-04-24 06:28

reporter   ~0031711

Last edited: 2012-04-24 09:11

I've fashioned a patch that works for us in 1.2.8 and applies to 1.2.10 without issue.

Probably not the most elegant solution (I couldn't get bug_update_field() to work for some reason), but it's simple to understand and does the job.

--- mantisbt-1.2.8/core/bugnote_api.php 2011-09-06 15:23:10.000000000 +0100
+++ mantis/core/bugnote_api.php 2012-04-24 11:20:37.794674092 +0100
@@ -484,7 +484,7 @@

  • @return bool
  • @access public
    */
    -function bugnote_date_update( $p_bugnote_id ) {
    +function bugnote_date_update( $p_bugnote_id, $p_bug_update=false ) {
    $c_bugnote_id = db_prepare_int( $p_bugnote_id );
    $t_bugnote_table = db_get_table( 'mantis_bugnote_table' );

@@ -493,6 +493,16 @@
WHERE id=" . db_param();
db_query_bound( $query, Array( db_now(), $c_bugnote_id ) );

  • if ( $p_bug_update ) {
  • $t_bug_id = bugnote_get_field( $p_bugnote_id, 'bug_id' );
  • $t_bug_table = db_get_table( 'mantis_bug_table' );
  • $query = "UPDATE $t_bug_table
  • SET last_updated=" . db_param() ."
  • WHERE id=" . db_param();
  • db_query_bound( $query, Array( db_now(), $t_bug_id ) );
  • }
  • db_query errors if there was a problem so:

    return true;
    }
    @@ -527,7 +537,7 @@
    db_query_bound( $query, Array( $p_bugnote_text, $t_bugnote_text_id ) );

    updated the last_updated date

  • bugnote_date_update( $p_bugnote_id );
  • bugnote_date_update( $p_bugnote_id, true );

    insert a new revision

    $t_user_id = auth_get_current_user_id();

:edit: Added the patch file as an upload.

PantsManUK

PantsManUK

2012-04-25 11:19

reporter   ~0031722

Last edited: 2012-04-25 11:20

By way of an FYI, I back-ported your fix and it works fine in 1.2.8. Many thanks, I knew there'd be a cleaner, more elegant solution. Just waiting for a release that includes this now.

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036270

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master b55ecbb5

2012-04-25 01:53

dregad


Details Diff
Update the bug's Last Update timestamp when editing a bugnote

Fixes 0007633
Affected Issues
0007633
mod - core/bugnote_api.php Diff File

MantisBT: master-1.2.x 55f0779c

2012-04-25 01:53

dregad


Details Diff
Update the bug's Last Update timestamp when editing a bugnote

Fixes 0007633
Affected Issues
0007633
mod - core/bugnote_api.php Diff File