Skip to content
Snippets Groups Projects

fix defaults

All threads resolved!

Files

@@ -19,6 +19,7 @@ use Drupal\Core\Field\PluginSettingsInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Form\SubformState;
use Drupal\Core\Url;
use Drupal\custom_elements\CustomElementGeneratorTrait;
use Drupal\custom_elements\CustomElementsFieldFormatterInterface;
use Drupal\custom_elements\CustomElementsFieldFormatterPluginManager;
use Drupal\custom_elements\Entity\EntityCeDisplayInterface;
@@ -51,6 +52,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
*/
class EntityCustomElementsDisplayEditForm extends EntityDisplayFormBase {
use CustomElementGeneratorTrait;
/**
* {@inheritdoc}
*/
@@ -611,19 +614,7 @@ class EntityCustomElementsDisplayEditForm extends EntityDisplayFormBase {
* {@inheritdoc}
*/
protected function getEntityDisplay($entity_type_id, $bundle, $mode) {
$entity_ce_display_storage = $this->entityTypeManager->getStorage('entity_ce_display');
$entity_ce_display_id = $entity_type_id . '.' . $bundle . '.' . $mode;
$entity_ce_display = $entity_ce_display_storage->load($entity_ce_display_id);
// Create new display when opening the form the first time.
if (empty($entity_ce_display)) {
/** @var \Drupal\custom_elements\Entity\EntityCeDisplay $entity_ce_display */
$entity_ce_display = $entity_ce_display_storage->create([
'targetEntityType' => $entity_type_id,
'bundle' => $bundle,
'mode' => $mode,
]);
}
return $entity_ce_display;
return $this->getCustomElementGenerator()->getEntityCeDisplay($entity_type_id, $bundle, $mode);
}
/**
Loading