AJAX error on Layout Builder for existing node without publish_state set

Created on 23 September 2022, almost 3 years ago
Updated 17 January 2024, over 1 year ago

Problem/Motivation

An AJAX error is thrown in Layout Builder for an existing node that does not have a publish_state value set (NULL):
Call to a member function getValue() on null in scheduler_content_moderation_integration_tokens()

This error is thrown on nodes of content types with moderation enabled in scheduler_content_moderation_integration_tokens() where it checks for the existence of the publish_state field and proceeds to fetch its value without perform a NULL check first.

Steps to reproduce

  1. Install the module.
  2. Open the Layout Builder interface on an existing moderated node.
  3. Attempt to configure/edit an existing block in the layout.
  4. The AJAX error will be thrown and prevents the block chooser panel from showing up.

Proposed resolution

A null check should be added to the logic in scheduler_content_moderation_integration_tokens() before proceeding to retrieve the field value.

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States edwardchiapet New York, NY

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024