moderationInformation property is not initialized even with NULL

Created on 7 June 2023, over 1 year ago
Updated 10 June 2023, over 1 year ago

Problem/Motivation

If content moderation module is not enabled, accessing a page that uses paragraph blocks breaks the page

Steps to reproduce

Create a page in layout builder that uses paragraph blocks, when accessing it, this happens

The website encountered an unexpected error. Please try again later.
Error: Typed property Drupal\paragraph_blocks\Plugin\Block\ParagraphBlock::$moderationInformation must not be accessed before initialization in Drupal\paragraph_blocks\Plugin\Block\ParagraphBlock->getLatestParagraph() (line 255 of modules/contrib/paragraph_blocks/src/Plugin/Block/ParagraphBlock.php).

Proposed resolution

See patch

Remaining tasks

None

User interface changes

None

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇵🇦Panama HakS

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

Comments & Activities

Production build 0.71.5 2024