MantisBT

View Issue Details Jump to Notes ] Wiki ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007633mantisbtbugtrackerpublic2006-12-07 11:472013-04-06 09:23
Reporterrobocoder 
Assigned Todregad 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.0.6 
Target Version1.2.11Fixed in Version1.2.11 
Summary0007633: Saving an edited note should touch bug's last_updated timestamp
DescriptionTechnically, this is an update.
Tags2.0.x check
Attached Filesdiff file icon bugnote_api.php.diff [^] (1,219 bytes) 2012-04-24 09:11 [Show Content]

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

-  Notes
User avatar (0031711)
PantsManUK (reporter)
2012-04-24 06:28
edited on: 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.

User avatar (0031722)
PantsManUK (reporter)
2012-04-25 11:19
edited on: 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.

User avatar (0036270)
grangeway (developer)
2013-04-05 17:57

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

- Related Changesets
MantisBT: master b55ecbb5
Timestamp: 2012-04-25 05:53:22
Author: dregad
Details ] Diff ]
Update the bug's Last Update timestamp when editing a bugnote

Fixes 0007633
mod - core/bugnote_api.php Diff ] File ]
MantisBT: master-1.2.x 55f0779c
Timestamp: 2012-04-25 05:53:22
Author: dregad
Details ] Diff ]
Update the bug's Last Update timestamp when editing a bugnote

Fixes 0007633
mod - core/bugnote_api.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2006-12-07 11:47 robocoder New Issue
2006-12-12 02:33 vboctor Status new => acknowledged
2012-04-23 14:38 atrol Relationship added has duplicate 0014181
2012-04-24 06:28 PantsManUK Note Added: 0031711
2012-04-24 06:55 PantsManUK Note Edited: 0031711 View Revisions
2012-04-24 09:11 PantsManUK File Added: bugnote_api.php.diff
2012-04-24 09:11 PantsManUK Note Edited: 0031711 View Revisions
2012-04-25 08:53 dregad Assigned To => dregad
2012-04-25 08:53 dregad Status acknowledged => assigned
2012-04-25 08:54 dregad Target Version => 1.2.11
2012-04-25 10:00 dregad Changeset attached => MantisBT master b55ecbb5
2012-04-25 10:00 dregad Changeset attached => MantisBT master-1.2.x 55f0779c
2012-04-25 10:00 dregad Status assigned => resolved
2012-04-25 10:00 dregad Resolution open => fixed
2012-04-25 10:00 dregad Fixed in Version => 1.2.11
2012-04-25 11:19 PantsManUK Note Added: 0031722
2012-04-25 11:20 PantsManUK Note Edited: 0031722 View Revisions
2012-06-06 23:53 jreese Status resolved => closed
2013-04-05 17:57 grangeway Status closed => acknowledged
2013-04-05 17:57 grangeway Note Added: 0036270
2013-04-05 18:33 grangeway Relationship added related to 0015721
2013-04-06 03:40 dregad Status acknowledged => closed
2013-04-06 07:23 grangeway Status closed => acknowledged
2013-04-06 09:22 dregad Tag Attached: 2.0.x check
2013-04-06 09:23 dregad Status acknowledged => closed


MantisBT 1.2.16dev master-1.2.x-05091f5 [^]
Copyright © 2000 - 2013 MantisBT Team
Time: 0.0792 seconds.
memory usage: 2,862 KB
Powered by Mantis Bugtracker