diff --git a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php index 4b3a04d..cf57104 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php @@ -444,8 +444,18 @@ public function getSchema() { if (!isset($this->schema)) { // Get the schema from the field item class. $definition = \Drupal::typedData()->getDefinition('field_type:' . $this->type); - $class = $definition['class']; - $schema = $class::schema($this); + // @todo BC layer schema not found, especially during install (image). + if (!empty($definition['class'])) { + $class = $definition['class']; + $schema = $class::schema($this); + } + else { + $module_handler = \Drupal::moduleHandler(); + module_load_install($this->module); + // Invoke hook_field_schema() for the field. + $schema = (array) $module_handler->invoke($this->module, 'field_schema', array($this)); + $schema += array('columns' => array(), 'indexes' => array(), 'foreign keys' => array()); + } // Fill in default values for optional entries. $schema += array('indexes' => array(), 'foreign keys' => array());