When a comment thread has multiple pages and the comment form is submitted, the page redirects to node/X?page=Y so as to show the last page where the comment was inserted. This breaks more comments as it throws off the page order. This patch fixes this.

It also introduces a "Load Previous Comments" button above the thread for pages where the thread does not start from the beginning (pages with the $_GET['page'])

CommentFileSizeAuthor
morecomments-respect_page_param.patch6.8 KBloze
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

loze’s picture

Status: Active » Needs review
dagmar’s picture

Status: Needs review » Needs work

Thanks, I saw this too. Some comments:

  1. +++ b/morecomments.js
    @@ -1,23 +1,37 @@
    +    attach: function(context, settings) {
    

    This was already implemented.

  2. +++ b/morecomments.js
    @@ -1,23 +1,37 @@
    +          console.log(Drupal.settings.morecomments_loaded_pages);
    

    No console.log please

  3. +++ b/morecomments.js
    @@ -1,23 +1,37 @@
    +          ¶
    

    Trailing spaces

  4. +++ b/morecomments.module
    @@ -45,10 +45,16 @@ function morecomments_form_node_type_form_alter(&$form, $form_state) {
    -  $form['comment']['morecomments_text'] = array(
    

    I would like to see a hook_update_N that remove the old variable.

  5. +++ b/morecomments.module
    @@ -80,7 +89,22 @@ function theme_morecomments_pager($variables) {
    +    $pages = ceil($node->comment_count/$comments_per_page);
    

    This doesn't follow drupal coding standars.