Skip to content
Snippets Groups Projects
Verified Commit 3b1e4652 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #221761 by mohit_aghera, pameeela, dixon_, catch, ged3000, sun,...

Issue #221761 by mohit_aghera, pameeela, dixon_, catch, ged3000, sun, deepakaryan1988, smustgrave, stefank, jredding, dawehner, harshit97, xjm, jhedstrom, geertvd, alexpott, Dries: Hide reply link for unpublished comments

(cherry picked from commit 6067ed42)
parent fd034b22
No related branches found
No related tags found
15 merge requests!10663Issue #3495778: Update phpdoc in FileSaveHtaccessLoggingTest,!10451Issue #3472458 by watergate, smustgrave: CKEditor 5 show blocks label is not translated,!103032838547 Fix punctuation rules for inline label suffix colon with CSS only,!10150Issue #3467294 by quietone, nod_, smustgrave, catch, longwave: Change string...,!10130Resolve #3480321 "Second level menu",!9936Issue #3483087: Check the module:// prefix in the translation server path and replace it with the actual module path,!9933Issue #3394728 by ankondrat4: Undefined array key "#prefix" and deprecated function: explode() in Drupal\file\Element\ManagedFile::uploadAjaxCallback(),!9914Issue #3451136 by quietone, gapple, ghost of drupal past: Improve...,!9882Draft: Issue #3481777 In bulk_form ensure the triggering element is the bulk_form button,!9839Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9815Issue #3480025: There is no way to remove entity cache items,!9757Issue #3478869 Add "All" or overview links to parent links,!9752Issue #3439910 by pooja_sharma, vensires: Fix Toolbar tests that rely on UID1's super user behavior,!9749Issue #3439910 by pooja_sharma, vensires: Fix Toolbar tests that rely on UID1's super user behavior,!9678Issue #3465132 by catch, Spokje, nod_: Show test run time by class in run-tests.sh output
Pipeline #292554 canceled
Pipeline: drupal

#292555

    ......@@ -184,7 +184,8 @@ protected function buildLinks(CommentInterface $entity, EntityInterface $comment
    ];
    }
    $field_definition = $commented_entity->getFieldDefinition($entity->getFieldName());
    if ($entity->access('create')
    if ($entity->isPublished()
    && $entity->access('create')
    && $field_definition->getSetting('default_mode') === CommentManagerInterface::COMMENT_MODE_THREADED) {
    $links['comment-reply'] = [
    'title' => t('Reply'),
    ......
    ......@@ -18,6 +18,31 @@ class CommentThreadingTest extends CommentTestBase {
    */
    protected $defaultTheme = 'stark';
    /**
    * Check the reply link on unpublished comments.
    */
    public function testCommentReplyLinkUnpublished(): void {
    // Set comments to have a subject with preview disabled.
    $this->setCommentPreview(DRUPAL_DISABLED);
    $this->setCommentForm(FALSE);
    $this->setCommentSettings('default_mode', CommentManagerInterface:: COMMENT_MODE_THREADED, 'Comment paging changed.');
    // Create a node.
    $this->drupalLogin($this->adminUser);
    $this->node = $this->drupalCreateNode(['type' => 'article', 'promote' => 1, 'uid' => $this->webUser->id()]);
    // Post comment #1.
    $comment_text = $this->randomMachineName();
    $comment1 = $this->postComment($this->node, $comment_text, '', TRUE);
    $this->drupalGet($this->node->toUrl());
    $this->assertSession()->pageTextContains('Reply');
    $comment1->setUnpublished();
    $comment1->save();
    $this->drupalGet($this->node->toUrl());
    $this->assertSession()->pageTextNotContains('Reply');
    }
    /**
    * Tests the comment threading.
    */
    ......@@ -33,7 +58,6 @@ public function testCommentThreading(): void {
    $this->node = $this->drupalCreateNode(['type' => 'article', 'promote' => 1, 'uid' => $this->webUser->id()]);
    // Post comment #1.
    $this->drupalLogin($this->webUser);
    $subject_text = $this->randomMachineName();
    $comment_text = $this->randomMachineName();
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment