Remove RevisionLogEntityTrait overrides in BlockContent

Created on 22 November 2023, 7 months ago
Updated 7 May 2024, about 2 months ago

Problem/Motivation

BlockContent currently implements all the get/setRevisionX functions that are already provided by RevisionLogEntityTrait. The implementations in BlockContent are slightly problematic in that some don't safeguard against NULLs. This lead to some weird failures here

https://git.drupalcode.org/issue/drupal-3038365/-/pipelines/53622/test_r...

With things like

Exception: Error: Call to a member function id() on null
Drupal\block_content\Entity\BlockContent->getRevisionUserId()() (Line: 280)

This does not happen with other entity types that use the trait, see RevisionVersionHistoryTest::testDescriptionRevLogNullValues.

The functions were originally added in #2716081: BlockContent should have revision_user and revision_created fields and implement RevisionLogInterface β†’ probably before the trait existed.

Steps to reproduce

Call getRevisionUserId() on a block content revision without a revision_user set.

Proposed resolution

Remove all overridden functions.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/A

πŸ“Œ Task
Status

Fixed

Version

10.2 ✨

Component
Block contentΒ  β†’

Last updated 5 days ago

Created by

πŸ‡¦πŸ‡ΊAustralia acbramley

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024