0001-Fix-missing-journal-indice-when-updating-a-journal.patch

Marius BALTEANU, 2019-06-20 23:34

Download (1.83 KB)

View differences:

app/helpers/journals_helper.rb
30 30
    links = []
31 31
    if journal.notes.present?
32 32
      if options[:reply_links]
33
        indice = journal.indice || @journal.issue.visible_journals_with_index.find{|j| j.id == @journal.id}.indice
33 34
        links << link_to(l(:button_quote),
34
                         quoted_issue_path(issue, :journal_id => journal, :journal_indice => journal.indice),
35
                         quoted_issue_path(issue, :journal_id => journal, :journal_indice => indice),
35 36
                         :remote => true,
36 37
                         :method => 'post',
37 38
                         :title => l(:button_quote),
test/functional/journals_controller_test.rb
257 257
    assert_equal 'text/javascript', response.content_type
258 258
    assert_equal 'Updated notes', Journal.find(2).notes
259 259
    assert_include 'journal-2-notes', response.body
260
    # response should include journal_indice param for quote link
261
    assert_include 'journal_indice=2', response.body
260 262
  end
261 263

  
262 264
  def test_update_xhr_with_private_notes_checked
263
-