From 53558d7de636276337af92a0a23f1a9237ef8f1e Mon Sep 17 00:00:00 2001 From: Marius BALTEANU Date: Thu, 20 Jun 2019 21:19:52 +0000 Subject: [PATCH] Fix missing journal indice when updating a journal --- app/helpers/journals_helper.rb | 3 ++- test/functional/journals_controller_test.rb | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb index 809afb4..391a432 100644 --- a/app/helpers/journals_helper.rb +++ b/app/helpers/journals_helper.rb @@ -30,8 +30,9 @@ module JournalsHelper links = [] if journal.notes.present? if options[:reply_links] + indice = journal.indice || @journal.issue.visible_journals_with_index.find{|j| j.id == @journal.id}.indice links << link_to(l(:button_quote), - quoted_issue_path(issue, :journal_id => journal, :journal_indice => journal.indice), + quoted_issue_path(issue, :journal_id => journal, :journal_indice => indice), :remote => true, :method => 'post', :title => l(:button_quote), diff --git a/test/functional/journals_controller_test.rb b/test/functional/journals_controller_test.rb index 0acf2d9..c2a21bc 100644 --- a/test/functional/journals_controller_test.rb +++ b/test/functional/journals_controller_test.rb @@ -257,6 +257,8 @@ class JournalsControllerTest < Redmine::ControllerTest assert_equal 'text/javascript', response.content_type assert_equal 'Updated notes', Journal.find(2).notes assert_include 'journal-2-notes', response.body + # response should include journal_indice param for quote link + assert_include 'journal_indice=2', response.body end def test_update_xhr_with_private_notes_checked -- 2.1.4