https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292017-05-24T14:37:54ZRedmineRedmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=787622017-05-24T14:37:54ZGo MAEDA
<ul></ul><p>Thank you for posting the patch.<br />But I think it would be better not to assume that the value of REPLIES_PER_PAGE constant is always 25. The test in your patch may fail if <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Respect "Objects per page" option when displaying forum replies (Closed)" href="https://www.redmine.org/issues/26033">#26033</a> is implemented.</p> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=787732017-05-25T06:57:22ZMinoru Maeda
<ul><li><strong>File</strong> <a href="/attachments/18402">reply_display_order_with_pre_page.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/18402/reply_display_order_with_pre_page.patch">reply_display_order_with_pre_page.patch</a> added</li></ul><p>Hello, Go MAEDA. Thank you for your advice.<br />I improved it in order of reply display considering "per_page".</p> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=793972017-06-22T11:29:48ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/26033">Feature #26033</a>: Respect "Objects per page" option when displaying forum replies</i> added</li></ul> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=793992017-06-22T11:31:01ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-1 priority-4 priority-default" href="/issues/11120">Patch #11120</a>: Order replies of messages boards based on user preference</i> added</li></ul> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=795842017-06-29T13:40:39ZGo MAEDA
<ul><li><strong>Target version</strong> set to <i>4.1.0</i></li></ul><p>The patch works fine for me. And it also implements <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Respect "Objects per page" option when displaying forum replies (Closed)" href="https://www.redmine.org/issues/26033">#26033</a>.<br />Setting target version to 3.5.0.</p> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=923672019-06-16T14:44:51ZPopoki Tom (@cat_in_136)
<ul></ul><p>This patch is great work but sometimes did not work well on my environment.</p>
my environment:
<ul>
<li>MySQL 5.6.42 (ClearDB)</li>
<li>Ruby 2.5.5p157</li>
<li>Redmine 4.0.3 + reply_display_order_with_pre_page.patch</li>
</ul>
When showing the topic where
<ul>
<li>count of the topic children is larger than <code>per_page_option</code>, and</li>
<li>some children has more than one attachment files</li>
</ul>
<p>In which case, <code>r=xx</code> parameter may not be expanded correctly due to incorrect paging.</p>
<p>On my environment, <code>@replies.pluck(:id)</code> generated an array containing duplicate IDs.<br />I could not identify the root cause, but I found a line <code>includes(:author, :attachments, {:board => :project})</code> cause this problem.<br />Therefore, I corrected this problem as follows to avoid this problem:</p>
<pre><code class="diff syntaxhl"><span class="gd">--- a/app/controllers/messages_controller.rb
</span><span class="gi">+++ b/app/controllers/messages_controller.rb
</span><span class="p">@@ -34,7 +34,6 @@</span> class MessagesController < ApplicationController
# Find the page of the requested reply
replies_order = User.current.wants_comments_in_reverse_order? ? 'DESC' : 'ASC'
@replies = @topic.children.
<span class="gd">- includes(:author, :attachments, {:board => :project}).
</span> reorder("#{Message.table_name}.created_on #{replies_order}, #{Message.table_name}.id #{replies_order}")
if params[:r] && page.nil?
<span class="p">@@ -45,6 +44,7 @@</span> class MessagesController < ApplicationController
@reply_count = @replies.count
@reply_pages = Paginator.new @reply_count, per_page_option, page
@replies = @replies.
<span class="gi">+ includes(:author, :attachments, {:board => :project}).
</span> limit(@reply_pages.per_page).
offset(@reply_pages.offset).
to_a
</code></pre> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=934312019-09-01T11:05:15ZPopoki Tom (@cat_in_136)
<ul><li><strong>File</strong> <a href="/attachments/23746">reply_display_order_with_pre_page_2.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/23746/reply_display_order_with_pre_page_2.patch">reply_display_order_with_pre_page_2.patch</a> added</li></ul><p>I improved Minoru-Maeda-san's patch. My patch includes:</p>
<ul>
<li>This issue <a class="issue tracker-3 status-1 priority-4 priority-default" title="Patch: Like issues and news comments, want to specify the display order of the forum's reply. (New)" href="https://www.redmine.org/issues/26030">#26030</a> itself;</li>
<li>display considering "per_page" (<a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Respect "Objects per page" option when displaying forum replies (Closed)" href="https://www.redmine.org/issues/26033">#26033</a>);</li>
<li>place "reply" block considering the display order (like <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Incorrect position of the "Associated revisions" block when comments are displayed in reverse chr... (Closed)" href="https://www.redmine.org/issues/31438">#31438</a>);</li>
<li>fix regression that I reported in <a class="issue tracker-3 status-1 priority-4 priority-default" title="Patch: Like issues and news comments, want to specify the display order of the forum's reply. (New)" href="https://www.redmine.org/issues/26030#note-6">#26030#note-6</a>;</li>
<li>fix regression where redirection after deleting a message raises an error; and </li>
<li>fix test codes to pass <code>rails test -n /Message.*Test/</code>.</li>
</ul> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=934322019-09-01T12:03:17ZMarius BĂLTEANU
<ul></ul><p>Popoki Tom (<a class="user active" href="https://www.redmine.org/users/142320">Popoki Tom (@cat_in_136)</a>) wrote:</p>
<blockquote>
<p>I improved Minoru-Maeda-san's patch. My patch includes:</p>
<ul>
<li>This issue <a class="issue tracker-3 status-1 priority-4 priority-default" title="Patch: Like issues and news comments, want to specify the display order of the forum's reply. (New)" href="https://www.redmine.org/issues/26030">#26030</a> itself;</li>
<li>display considering "per_page" (<a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Respect "Objects per page" option when displaying forum replies (Closed)" href="https://www.redmine.org/issues/26033">#26033</a>);</li>
<li>place "reply" block considering the display order (like <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Incorrect position of the "Associated revisions" block when comments are displayed in reverse chr... (Closed)" href="https://www.redmine.org/issues/31438">#31438</a>);</li>
<li>fix regression that I reported in <a class="issue tracker-3 status-1 priority-4 priority-default" title="Patch: Like issues and news comments, want to specify the display order of the forum's reply. (New)" href="https://www.redmine.org/issues/26030#note-6">#26030#note-6</a>;</li>
<li>fix regression where redirection after deleting a message raises an error; and </li>
<li>fix test codes to pass <code>rails test -n /Message.*Test/</code>.</li>
</ul>
</blockquote>
<p>Thanks for updating the patch. Can you check the content of <code>test/integration/messages_test.rb</code>? It seems the class <code>class MessagesTest</code> is duplicated.</p> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=939922019-09-27T22:33:01ZGo MAEDA
<ul><li><strong>Target version</strong> changed from <i>4.1.0</i> to <i>4.2.0</i></li></ul> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=940112019-09-28T12:52:53ZPopoki Tom (@cat_in_136)
<ul><li><strong>File</strong> <a href="/attachments/23986">reply_display_order_with_pre_page_3.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/23986/reply_display_order_with_pre_page_3.patch">reply_display_order_with_pre_page_3.patch</a> added</li></ul><p>Opps, Thank you for checking my patch. I've removed the duplicated <code>MessageTest</code>.</p> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=956302020-01-11T02:00:23ZPopoki Tom (@cat_in_136)
<ul></ul><p>Popoki Tom (<a class="user active" href="https://www.redmine.org/users/142320">Popoki Tom (@cat_in_136)</a>) wrote:</p>
<blockquote>
<p>Opps, Thank you for checking my patch. I've removed the duplicated <code>MessageTest</code>.</p>
</blockquote>
<p>My patch has still a some degrade bug where <code>r=xx</code> parameter may not be expanded correctly. This patch should not be merged.</p> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=984642020-07-05T07:48:03ZPopoki Tom (@cat_in_136)
<ul><li><strong>File</strong> <a href="/attachments/25649">reply_display_order_with_pre_page_4.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/25649/reply_display_order_with_pre_page_4.patch">reply_display_order_with_pre_page_4.patch</a> added</li></ul><p>4th revision of the patch attached.</p>
<p>I've rewrite MessageController#show to fix degrade bug where `r=xx` parameter may not be expanded correctly.<br />My internal testing (dogfooding) is on-going on my private redmine instance.</p> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=1015372021-03-25T07:31:44ZMarius BĂLTEANU
<ul><li><strong>Target version</strong> changed from <i>4.2.0</i> to <i>5.0.0</i></li></ul> Redmine - Patch #26030: Like issues and news comments, want to specify the display order of the forum's reply.https://www.redmine.org/issues/26030?journal_id=1060712022-03-21T20:08:20ZMarius BĂLTEANU
<ul><li><strong>Target version</strong> changed from <i>5.0.0</i> to <i>Candidate for next major release</i></li></ul>