Skip to content
Snippets Groups Projects
Verified Commit 6118ef1b authored by Dave Long's avatar Dave Long
Browse files

Issue #3403265 by acbramley: Remove RevisionLogEntityTrait overrides in BlockContent

(cherry picked from commit 4203cff7)
parent 89944826
Branches
Tags
20 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.,!7567Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7565Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7509Change label "Block description" to "Block type",!7344Issue #3292350 by O'Briat, KlemenDEV, hswong3i, smustgrave, quietone: Update...,!6922Issue #3412959 by quietone, smustgrave, longwave: Fix 12 'un' words,!6848Issue #3417553 by longwave: Remove withConsecutive() in CacheCollectorTest,!6720Revert "Issue #3358581 by pfrenssen, _tarik_, a.dmitriiev, smustgrave:...,!6560Update ClaroPreRender.php, confirming classes provided are in array format,!6528Issue #3414261 by catch: Add authenticated user umami performance tests,!6501Issue #3263668 by omkar-pd, Wim Leers, hooroomoo: Re-enable inline form errors...,!6354Draft: Issue #3380392 by phma: Updating language weight from the overview reverts label if translated,!6324Issue #3416723 by Ludo.R: Provide a "node type" views default argument,!6119Issue #3405704 by Spokje, longwave: symfony/psr-http-message-bridge major version bump,!5950Issue #3403653 by alexpott, longwave: Incorporate improvements to how contrib runs PHPStan to core,!5858Issue #3401971 by fjgarlin: Test-only job shouldn't require constant rebases...,!5716Draft: Issue #3401102 by Spokje, longwave, smustgrave: Nightwatch artifacts on GitLab not retained,!5674Transaction autocommit during shutdown relies on unreliable object destruction order,!5644Issue #3395563 by nireneko, marvil07, lauriii, borisson_, smustgrave, Wim...
Pipeline #54058 canceled
Pipeline: drupal

#54063

    Pipeline: drupal

    #54062

      Pipeline: drupal

      #54061

        +1
        ......@@ -8,7 +8,6 @@
        use Drupal\Core\Entity\EntityTypeInterface;
        use Drupal\Core\Field\BaseFieldDefinition;
        use Drupal\block_content\BlockContentInterface;
        use Drupal\user\UserInterface;
        /**
        * Defines the content block entity class.
        ......@@ -242,63 +241,6 @@ public function setInfo($info) {
        return $this;
        }
        /**
        * {@inheritdoc}
        */
        public function getRevisionCreationTime() {
        return $this->get('revision_created')->value;
        }
        /**
        * {@inheritdoc}
        */
        public function setRevisionCreationTime($timestamp) {
        $this->set('revision_created', $timestamp);
        return $this;
        }
        /**
        * {@inheritdoc}
        */
        public function getRevisionUser() {
        return $this->get('revision_user')->entity;
        }
        public function setRevisionUser(UserInterface $account) {
        $this->set('revision_user', $account);
        return $this;
        }
        /**
        * {@inheritdoc}
        */
        public function getRevisionUserId() {
        return $this->get('revision_user')->entity->id();
        }
        /**
        * {@inheritdoc}
        */
        public function setRevisionUserId($user_id) {
        $this->set('revision_user', $user_id);
        return $this;
        }
        /**
        * {@inheritdoc}
        */
        public function getRevisionLogMessage() {
        return $this->get('revision_log')->value;
        }
        /**
        * {@inheritdoc}
        */
        public function setRevisionLogMessage($revision_log_message) {
        $this->set('revision_log', $revision_log_message);
        return $this;
        }
        /**
        * {@inheritdoc}
        */
        ......
        <?php
        namespace Drupal\Tests\block_content\Kernel;
        use Drupal\block_content\Entity\BlockContent;
        use Drupal\KernelTests\KernelTestBase;
        use Drupal\block_content\Entity\BlockContentType;
        /**
        * Tests revision based functions for Block Content.
        *
        * @group block_content
        */
        class BlockContentRevisionsTest extends KernelTestBase {
        /**
        * {@inheritdoc}
        */
        protected static $modules = [
        'block',
        'block_content',
        'system',
        'user',
        ];
        /**
        * {@inheritdoc}
        */
        public function setUp(): void {
        parent::setUp();
        $this->installEntitySchema('user');
        $this->installEntitySchema('block_content');
        }
        /**
        * Tests block content revision user id doesn't throw error with null field.
        */
        public function testNullRevisionUser(): void {
        BlockContentType::create([
        'id' => 'basic',
        'label' => 'A basic block type',
        ])->save();
        $block = BlockContent::create([
        'info' => 'Test',
        'type' => 'basic',
        'revision_user' => NULL,
        ]);
        $block->save();
        $this->assertNull($block->getRevisionUserId());
        }
        }
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment