Skip to content
Snippets Groups Projects
Verified Commit ba543b96 authored by Dave Long's avatar Dave Long
Browse files

Issue #2985882 by tim.plunkett, Mirakolous, ravi.shankar, ayush9598, Rajab...

Issue #2985882 by tim.plunkett, Mirakolous, ravi.shankar, ayush9598, Rajab Natshah, andypost, Anybody, kattekrab, devarch, Freddy Rodriguez, adubovskoy, corneliusd, mradcliffe, longwave, lukasss, Pancho, Graber, dpi, joshf, lordzik, dorianwinterfeld, jacov, kdmdrupal, jlancaster, jborgesr, joarferme, tonytheferg, chrisrockwell, agilman, kducharm, Sam152, scotwith1t, labboy0276, Spokje, jazzfiction, Shrutidkadam, ab2211, Dave Kopecek, segx, alexmoreno, themaurice, the_glitch, NWOM, kwfinken, berliner, design.er, ouissla, zterry95, jamsilver, fonant, Rajendar Reddy, Christopher Riley, BramDriesen, webdrips: Workaround for "Call to a member function getLabel() after enabling layout_builder"

(cherry picked from commit 4b2afe95)
parent 8f222442
No related branches found
No related tags found
4 merge requests!8506Draft: Issue #3456536 by ibrahim tameme,!5646Issue #3350972 by nod_: [random test failure]...,!5600Issue #3350972 by nod_: [random test failure]...,!5343Issue #3305066 by quietone, Rename RedirectLeadingSlashesSubscriber
......@@ -9,6 +9,7 @@
use Drupal\Core\Field\FieldConfigInterface;
use Drupal\Core\Field\FieldTypePluginManagerInterface;
use Drupal\Core\Field\FormatterPluginManager;
use Drupal\Core\Logger\LoggerChannelTrait;
use Drupal\Core\Plugin\Context\ContextDefinition;
use Drupal\Core\Plugin\Context\EntityContextDefinition;
use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
......@@ -24,6 +25,7 @@
class FieldBlockDeriver extends DeriverBase implements ContainerDeriverInterface {
use StringTranslationTrait;
use LoggerChannelTrait;
/**
* The entity type repository.
......@@ -99,7 +101,12 @@ public function getDerivativeDefinitions($base_plugin_definition) {
foreach ($field_info['bundles'] as $bundle) {
$derivative = $base_plugin_definition;
$field_definition = $this->entityFieldManager->getFieldDefinitions($entity_type_id, $bundle)[$field_name];
$field_definitions = $this->entityFieldManager->getFieldDefinitions($entity_type_id, $bundle);
if (empty($field_definitions[$field_name])) {
$this->getLogger('field')->error('Field %field_name exists but is missing a corresponding field definition and may be misconfigured.', ['%field_name' => "$entity_type_id.$bundle.$field_name"]);
continue;
}
$field_definition = $field_definitions[$field_name];
// Store the default formatter on the definition.
$derivative['default_formatter'] = '';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment