getPropertyPathDependencies() can set an empty dependency which then crashes config

Created on 12 June 2024, 3 months ago

Problem/Motivation

This code in getPropertyPathDependencies(): expects to always get a dependency:

    if ($property instanceof FieldStorageDefinitionInterface) {
      $dependencies->addDependency('module', $property->getProvider());
    }

but if the field is a base field, BaseFieldDefinition (which is a FieldStorageDefinitionInterface) can return NULL:

  public function getProvider() {
    return $this->definition['provider'] ?? NULL;
  }

This then puts an empty dependency in the modules, and then a subsequent config import fails:

  Configuration <em class="placeholder">search_api.index.dev_date_recur_search_api</em> depends on the <em class="placeholder"></em> module that will not
   be installed after import.

Steps to reproduce

Proposed resolution

Remaining tasks

🐛 Bug report
Status

Active

Version

1.0

Component

General code

Created by

🇬🇧United Kingdom joachim

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

Comments & Activities

Production build 0.71.5 2024