Defect #39932
closed
Incorrect position of "Edited" mark in issue notes with h4 headings
Added by Yasu Saku about 2 years ago.
Updated about 2 years ago.
Description
"Edited tag" position is incorrect after issue note update, but it is correct after the page is reloaded.
Steps to reproduce:¶
- Edit the existing note using the Edit Note button in the issue history.
- Update note containing H4 tags.

My Environment:¶
Redmine version 5.1.1.stable
Ruby version 3.2.2-p53 (2023-03-30) [x86_64-linux]
Rails version 6.1.7.6
Proposal:¶
To resolve this issue, I believe it might be sufficient to make corrections to the following sections.
diff --git a/app/views/journals/update.js.erb b/app/views/journals/update.js.erb
index 87320c5d4a..0b9f99a31a 100644
--- a/app/views/journals/update.js.erb
+++ b/app/views/journals/update.js.erb
@@ -7,7 +7,7 @@
$("#journal-<%= @journal.id %>-notes").replaceWith('<%= escape_javascript(render_notes(@journal.issue, @journal, :reply_links => authorize_for('issues', 'edit'))) %>');
$("#journal-<%= @journal.id %>-notes").show();
$("#journal-<%= @journal.id %>-form").remove();
- var journal_header = $("#change-<%= @journal.id %> h4");
+ var journal_header = $("#change-<%= @journal.id %>>div.note>h4.note-header");
var journal_updated_info = journal_header.find("span.update-info");
if (journal_updated_info.length > 0) {
journal_updated_info.replaceWith('<%= escape_javascript(render_journal_update_info(@journal)) %>');
source:/tags/5.1.1/app/views/journals/update.js.erb#L10
Files
- Status changed from New to Confirmed
Thank you for reporting and fixing the issue.
But I think that adding note-hader class to the h4 element is enough to target the correct h4 element. It is less likely to break if there are minor changes in the HTML structure.
diff --git a/app/views/journals/update.js.erb b/app/views/journals/update.js.erb
index 87320c5d4..37ba35602 100644
--- a/app/views/journals/update.js.erb
+++ b/app/views/journals/update.js.erb
@@ -7,7 +7,7 @@
$("#journal-<%= @journal.id %>-notes").replaceWith('<%= escape_javascript(render_notes(@journal.issue, @journal, :reply_links => authorize_for('issues', 'edit'))) %>');
$("#journal-<%= @journal.id %>-notes").show();
$("#journal-<%= @journal.id %>-form").remove();
- var journal_header = $("#change-<%= @journal.id %> h4");
+ var journal_header = $("#change-<%= @journal.id %> h4.note-header");
var journal_updated_info = journal_header.find("span.update-info");
if (journal_updated_info.length > 0) {
journal_updated_info.replaceWith('<%= escape_javascript(render_journal_update_info(@journal)) %>');
- Target version set to 5.1.2
- Subject changed from "Edited tag" position is incorrect after issue note update to Incorrect position of "Edited" mark in journals with h4 headings
- Status changed from Confirmed to Resolved
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the patch in r22561.
- Subject changed from Incorrect position of "Edited" mark in journals with h4 headings to Incorrect position of "Edited" mark in issue notes with h4 headings
Mr. Go MAEDA , thank you for your prompt response.
- Status changed from Resolved to Closed
Also available in: Atom
PDF