Problem/Motivation
I'm getting the following notice:
Notice: Undefined offset: 1 in Drupal\Core\Entity\EntityDisplayRepository->getAllDisplayModesByEntityType() (line 115 of core/lib/Drupal/Core/Entity/EntityDisplayRepository.php).
Drupal\Core\Entity\EntityDisplayRepository->getAllDisplayModesByEntityType('view_mode') (Line: 142)
Drupal\Core\Entity\EntityDisplayRepository->getDisplayModesByEntityType('view_mode', 'block_content') (Line: 78)
Drupal\Core\Entity\EntityDisplayRepository->getViewModes('block_content') (Line: 165)
Drupal\field_ui\Plugin\Derivative\FieldUiLocalTask->getDerivativeDefinitions(Array) (Line: 101)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array) (Line: 87)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 284)
Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 175)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 201)
Drupal\Core\Menu\LocalTaskManager->getDefinitions() (Line: 226)
Drupal\Core\Menu\LocalTaskManager->getLocalTasksForRoute('entity.menu.collection') (Line: 310)
Drupal\Core\Menu\LocalTaskManager->getTasksBuild('entity.menu.collection', Object) (Line: 378)
Drupal\Core\Menu\LocalTaskManager->getLocalTasks('entity.menu.collection', 0) (Line: 95)
Drupal\Core\Menu\Plugin\Block\LocalTasksBlock->build() (Line: 171)
Drupal\block\BlockViewBuilder::preRender(Array)
This error seems to be proceeding from Drupal\Core\Entity\EntityDisplayRepository->getAllDisplayModesByEntityType(). Line 115
113 $this->displayModeInfo[$display_type] = [];
114 foreach ($this->entityTypeManager->getStorage($entity_type_id)->loadMultiple() as $display_mode) {
115 list($display_mode_entity_type, $display_mode_name) = explode('.', $display_mode->id(), 2);
116 $this->displayModeInfo[$display_type][$display_mode_entity_type][$display_mode_name] = $display_mode->toArray();
117 }
118 $this->moduleHandler->alter($key, $this->displayModeInfo[$display_type]);
119 $this->cacheSet("$key:$langcode", $this->displayModeInfo[$display_type], CacheBackendInterface::CACHE_PERMANENT, ['entity_types', 'entity_field_info']);
I attach an image.
Steps to reproduce
Every time I update the cache in my environment, I'm getting this notice in each page that I access.
Proposed resolution
Here I found a possible solution and at first sight it seems to work, I'm not getting the error anymore: https://www.daniweb.com/programming/web-development/threads/452877/how-t...