Comment field instance settings has "default_mode" to switch threading for comments.
Switch it to COMMENT_MODE_FLAT as all forums use

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sjancich’s picture

Assigned: Unassigned » sjancich
larowlan’s picture

Do we need a test?

andypost’s picture

Would be good to have a test

andypost’s picture

Suppose the quick fix here is to change setting in hook_install()

mitsuroseba’s picture

Status: Active » Needs review
FileSize
2.47 KB

Status: Needs review » Needs work

The last submitted patch, 5: forum-comments-non-threaded-2301247-5.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: forum-comments-non-threaded-2301247-5.patch, failed testing.

andypost’s picture

Version: 8.0.x-dev » 8.x-dev

tested this locally and no failures detected

andypost’s picture

Version: 8.x-dev » 8.0.x-dev

The last submitted patch, 5: forum-comments-non-threaded-2301247-5.patch, failed testing.

jthorson’s picture

GET http://10.20.0.214/checkout/checkout/comment/reply/node/1/comment_forum/1 returned 404 (3.69 KB).

Note the duplicate 'checkout' in the URL ... that should not be there. The testbot installs in a subdirectory (i.e. not at the web root), whereas I suspect your local tests which are passing are on a site installed at '/'.

The verbose output for the failed tests is a 'Page not found'.

mitsuroseba’s picture

Status: Needs work » Needs review
FileSize
2.42 KB

Thank you, @jthorson!

mitsuroseba’s picture

FileSize
755 bytes

interdiff.

andypost’s picture

Assigned: sjancich » larowlan
Status: Needs review » Reviewed & tested by the community

Great! @larowlan are you agree?

larowlan’s picture

Assigned: larowlan » Unassigned

Fine by me

alexpott’s picture

Assigned: Unassigned » larowlan
Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/forum/src/Tests/ForumTest.php
    @@ -469,6 +469,31 @@ function testForumWithNewPost() {
       /**
    +   * Tests that forum comments have COMMENT_MODE_FLAT instead of threading mode.
    +   */
    +  function testCommentFlatMode() {
    +    // Login as the first user.
    +    $this->drupalLogin($this->admin_user);
    +    // Create a forum container.
    +    $this->forumContainer = $this->createForum('container');
    +    // Create a forum.
    +    $this->forum = $this->createForum('forum');
    +    // Create a topic.
    +    $node = $this->createForumTopic($this->forum, FALSE);
    +
    +    $this->drupalLogin($this->post_comment_user);
    +    // Post a reply to the topic.
    +    $edit = array();
    +    $edit['subject[0][value]'] = $this->randomName();
    +    $edit['comment_body[0][value]'] = $this->randomName();
    +    $this->drupalPostForm('node/' . $node->id(), $edit, t('Save'));
    +
    +    $this->drupalPostForm('comment/reply/node/'. $node->id() . '/comment_forum/1', $edit, t('Save'));
    +    $indented = $this->cssSelect('div .indented .comment');
    +    $this->assertTrue(empty($indented), 'Check that comment display in flat mode');
    +  }
    

    I don;t think we need to tests in the Forum module for non threaded comments - this is extensively tested elsewhere - we're just using another module's API here.

mitsuroseba’s picture

Status: Needs work » Needs review
FileSize
1.08 KB

Thank you, @alexpott!
Remove test.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

back to rtbc

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed dc11fb9 and pushed to 8.0.x. Thanks!

  • alexpott committed dc11fb9 on 8.0.x
    Issue #2301247 by mitsuroseba | andypost: Make comments for forum non-...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.