Actions
Defect #33610
openSubmitting the edit issue form without changing any field updates updated_on column
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Affected version:
Description
The procedure below updates updated_on
column in issues
table, even though any fields on the issue are not updated and no journal is created.
Steps to reproduce:
1. Open the edit issue form
2. Click the Submit button without changing any value
3. The timestamp of the issue is updated but no journal is created
The behavior I expect:
The updated_on
column should not be updated when no changes are made
Files
Updated by Yuichi HARADA over 4 years ago
- File fix-33610.patch fix-33610.patch added
I've confirmed.
In the Journal model, Journal#save (source:trunk/app/models/journal.rb#L85) will not run if notes and details are empty.
I think that it will be solved if the same judgment is performed as follows.
diff --git a/app/models/issue.rb b/app/models/issue.rb
index a89f23dd8..5027376f7 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -1853,7 +1853,7 @@ class Issue < ActiveRecord::Base
# Make sure updated_on is updated when adding a note and set updated_on now
# so we can set closed_on with the same value on closing
def force_updated_on_change
- if @current_journal || changed?
+ if changed? || (@current_journal && !@current_journal.notes_and_details_empty?)
self.updated_on = current_time_from_proper_timezone
if new_record?
self.created_on = updated_on
diff --git a/app/models/journal.rb b/app/models/journal.rb
index e60605161..48d06fbef 100644
--- a/app/models/journal.rb
+++ b/app/models/journal.rb
@@ -82,7 +82,11 @@ class Journal < ActiveRecord::Base
def save(*args)
journalize_changes
# Do not save an empty journal
- (details.empty? && notes.blank?) ? false : super
+ notes_and_details_empty? ? false : super
+ end
+
+ def notes_and_details_empty?
+ notes.blank? && details.empty?
end
# Returns journal details that are visible to user
Updated by Go MAEDA about 4 years ago
- Target version set to Candidate for next major release
Actions