Undefined property: $derivativeId

Created on 2 August 2023, over 1 year ago

Problem/Motivation

On a site I'm upgrading to D10, I'm seeing lots of these errors for each of the components:

Undefined property: Drupal\layout_builder_kit\Plugin\Block\LBKImage\LBKImage::$derivativeId

Steps to reproduce

  • Set version to 2.x
  • Upgrade to 10.0

Proposed resolution

These methods aren't needed:

  /**
   * {@inheritdoc}
   */
  public function getPluginDefinition() {
    return $this->pluginDefinition;
  }

  /**
   * {@inheritdoc}
   */
  public function getPluginId() {
    return $this->pluginId;
    }

  /**
   * {@inheritdoc}
   */
  public function getBaseId() {
    return $this->baseId;
  }

  /**
   * {@inheritdoc}
   */
  public function getDerivativeId() {
    return $this->derivativeId;
  }

Also, add the baseId in the LBKBaseComponent and, for completeness, add:

  public function getDerivativeDefinition($derivative_id) {
    // Since this block plugin has no derivatives, we simply return null.
    return null;
  }
πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States aangel

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

Comments & Activities

Production build 0.71.5 2024