Loading scheduler.install +12 −0 Original line number Diff line number Diff line Loading @@ -250,3 +250,15 @@ function scheduler_update_8207() { return t('No update required.'); } } /** * Show/hide entity form fields to match Scheduling enabled/disabled settings. */ function scheduler_update_8208() { if ($result = \Drupal::service('scheduler.manager')->resetFormDisplayFields()) { return implode('</li><li>', $result); } else { return t('No update required.'); } } scheduler.module +65 −4 Original line number Diff line number Diff line Loading @@ -534,6 +534,9 @@ function _scheduler_entity_type_form_alter(&$form, FormStateInterface $form_stat ]; $form['#entity_builders'][] = '_scheduler_form_entity_type_form_builder'; // Add a custom submit handler to adjust the fields in the form displays. $form['actions']['submit']['#submit'][] = '_scheduler_form_entity_type_submit'; } /** Loading @@ -554,6 +557,64 @@ function _scheduler_form_entity_type_form_builder($entity_type, $type, &$form, F $type->setThirdPartySetting('scheduler', 'unpublish_revision', $form_state->getValue('scheduler_unpublish_revision')); } /** * Entity type form submit handler. */ function _scheduler_form_entity_type_submit($form, FormStateInterface $form_state) { // Get the entity type id (node, media, taxonomy_term, etc.) $entity_type_id = $form_state->getFormObject()->getEntity()->getEntityType()->getBundleOf(); // Get the entity bundle id (page, article, image, etc.) $bundle_id = $form_state->getFormObject()->getEntity()->id(); /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ $display_repository = \Drupal::service('entity_display.repository'); // Get all active display modes. getFormModes() returns the additional modes // then add the default. $all_display_modes = array_keys($display_repository->getFormModes($entity_type_id)); $all_display_modes[] = $display_repository::DEFAULT_DISPLAY_MODE; $supported_display_modes = \Drupal::service('scheduler.manager')->getPlugin($entity_type_id)->entityFormDisplayModes(); // Each of the active form display modes may need to be adjusted to add or // remove the scheduler fields depending on the 'enable' setting. foreach ($all_display_modes as $display_mode) { $form_display = $display_repository->getFormDisplay($entity_type_id, $bundle_id, $display_mode); // If this bundle is not enabled for scheduled publishing or the form // display mode is not supported then make sure the publish_on field is // disabled in the form display. if (!$form_state->getValue('scheduler_publish_enable') || !in_array($display_mode, $supported_display_modes)) { $form_display->removeComponent('publish_on')->save(); } // @todo Find a more robust way to detect that the checkbox was off before. elseif (!$form['scheduler']['publish']['scheduler_publish_enable']['#default_value']) { // If the entity bundle is now enabled for scheduled publishing but was // not enabled before then set the publish_on field to be displayed and // set the widget type to 'datetime_timestamp_no_default'. Only do this // when the checkbox has been changed, because the widget could be altered // or the field moved by a subsequent process or manually by admin. $form_display->setComponent('scheduler_settings', ['weight' => 50]) ->setComponent('publish_on', ['type' => 'datetime_timestamp_no_default', 'weight' => 52])->save(); } // Do the same for the unpublish_on field. if (!$form_state->getValue('scheduler_unpublish_enable') || !in_array($display_mode, $supported_display_modes)) { $form_display->removeComponent('unpublish_on')->save(); } elseif (!$form['scheduler']['unpublish']['scheduler_unpublish_enable']['#default_value']) { $form_display->setComponent('scheduler_settings', ['weight' => 50]) ->setComponent('unpublish_on', ['type' => 'datetime_timestamp_no_default', 'weight' => 54])->save(); } // If the display mode is not supported then also remove the // scheduler_settings group fieldset. if (!in_array($display_mode, $supported_display_modes)) { $form_display->removeComponent('scheduler_settings')->save(); } } } /** * Form alter handling for Devel Generate forms. */ Loading Loading @@ -699,7 +760,7 @@ function scheduler_entity_base_field_info(EntityTypeInterface $entity_type) { ->setLabel(t('Publish on')) ->setDisplayOptions('form', [ 'type' => 'datetime_timestamp_no_default', 'weight' => 30, 'region' => 'hidden', ]) ->setDisplayConfigurable('form', TRUE) ->setTranslatable(TRUE) Loading @@ -710,7 +771,7 @@ function scheduler_entity_base_field_info(EntityTypeInterface $entity_type) { ->setLabel(t('Unpublish on')) ->setDisplayOptions('form', [ 'type' => 'datetime_timestamp_no_default', 'weight' => 30, 'region' => 'hidden', ]) ->setDisplayConfigurable('form', TRUE) ->setTranslatable(TRUE) Loading Loading @@ -1016,11 +1077,11 @@ function scheduler_entity_extra_field_info() { $unpublishing_enabled = $type->getThirdPartySetting('scheduler', 'unpublish_enable', $config->get('default_unpublish_enable')); if ($publishing_enabled || $unpublishing_enabled) { // Weight 20 puts this below the core fields by default. // Weight 50 puts this below the core fields by default. $fields[$entityTypeId][$type->id()]['form']['scheduler_settings'] = [ 'label' => t('Scheduler Dates'), 'description' => t('Fieldset containing Scheduler Publish-on and Unpublish-on date input fields'), 'weight' => 20, 'weight' => 50, ]; } } Loading src/SchedulerManager.php +124 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Link; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Url; use Psr\Log\LoggerInterface; Loading Loading @@ -1336,4 +1337,127 @@ class SchedulerManager { return $output; } /** * Reset the form display fields to match the Scheduler enabled settings. * * The Scheduler fields are disabled by default and only enabled in a form * display when that entity bundle is enabled for scheduled publishing or * unpublishing. See _scheduler_form_entity_type_submit() for details. * * This was a design change during the development of Scheduler 2.0 and any * site that had installed Scheduler prior to 2.0-rc8 will have all fields * enabled. Whilst this should not be a problem, it is preferrable to update * the displays to match the scenario when the modules is freshly installed. * Hence this function was added and called from scheduler_update_8208(). */ public function resetFormDisplayFields() { /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ $display_repository = \Drupal::service('entity_display.repository'); $fields_displayed = []; $fields_hidden = []; foreach ($this->getPlugins() as $entityTypeId => $plugin) { // Get all active display modes. getFormModes() returns the additional // modes then add the default. $all_display_modes = array_keys($display_repository->getFormModes($entityTypeId)); $all_display_modes[] = $display_repository::DEFAULT_DISPLAY_MODE; $supported_display_modes = $plugin->entityFormDisplayModes(); $bundles = $plugin->getTypes(); foreach ($bundles as $bundle_id => $bundle) { foreach ($all_display_modes as $display_mode) { $form_display = $display_repository->getFormDisplay($entityTypeId, $bundle_id, $display_mode); foreach (['publish', 'unpublish'] as $value) { $field = $value . '_on'; $setting = $value . '_enable'; // If this bundle is not enabled for scheduled (un)publishing or the // form display mode is not supported then remove the field. if (!$bundle->getThirdPartySetting('scheduler', $setting, FALSE) || !in_array($display_mode, $supported_display_modes)) { $form_display->removeComponent($field)->save(); if ($display_mode == $display_repository::DEFAULT_DISPLAY_MODE) { $fields_hidden[$field]["{$bundle->getEntityType()->getCollectionLabel()}"][] = $bundle->label(); } } else { // Scheduling is enabled. Get the existing component to preserve // any changed settings, but if the type is empty or set the to // the core default 'datetime_timestamp' then change it to // Scheduler's 'datetime_timestamp_no_default'. $component = $form_display->getComponent($field); if (empty($component['type']) || $component['type'] == 'datetime_timestamp') { $component['type'] = 'datetime_timestamp_no_default'; } $component['weight'] = ($field == 'publish_on' ? 52 : 54); // Make sure the field and the settings group are displayed. $form_display->setComponent('scheduler_settings', ['weight' => 50]) ->setComponent($field, $component)->save(); if ($display_mode == $display_repository::DEFAULT_DISPLAY_MODE) { $fields_displayed[$field]["{$bundle->getEntityType()->getCollectionLabel()}"][] = $bundle->label(); } } } // If the display mode is not supported remove the group fieldset. if (!in_array($display_mode, $supported_display_modes)) { $form_display->removeComponent('scheduler_settings')->save(); } } } } // It is not possible to determine whether a field on an enabled entity type // had been manually hidden before this update. It is a rare scenario but // inform the admin that there is potentially some manual work to do. $uri = 'https://www.drupal.org/project/scheduler/issues/3320341'; $link = Link::fromTextAndUrl($this->t('Scheduler issue 3320341'), Url::fromUri($uri)); \Drupal::messenger()->addMessage($this->t( 'The Scheduler fields are now hidden by default and automatically changed to be displayed when an entity bundle is enabled for scheduling. If you have previously manually hidden scheduler fields for enabled entity types then these fields will now be displayed. You will need to manually hide them again or implement hook_scheduler_hide_publish_date() or hook_scheduler_{TYPE}_hide_publish_date() and the equivalent for unpublish_date. See @issue for details.', ['@issue' => $link->toString()]), MessengerInterface::TYPE_STATUS, FALSE); $this->logger->warning( 'The Scheduler fields are now hidden by default and automatically changed to be displayed when an entity bundle is enabled for scheduling. If you have previously manually hidden scheduler fields for enabled entity types then these fields will now be displayed. You will need to manually hide them again or implement hook_scheduler_hide_publish_date() or hook_scheduler_{TYPE}_hide_publish_date() and the equivalent for unpublish_date. See @issue for details.', ['@issue' => $link->toString(), 'link' => $link->toString()] ); /** * Helper function to format the list of fields on bundles. */ function formatOutputText($fields) { return implode(', ', array_map(function ($name, $bundles) { return "$name (" . implode(',', $bundles) . ")"; }, array_keys($fields), $fields)); } $output = []; if (isset($fields_displayed['publish_on'])) { $output[] = $this->t('Publish On field displayed for: @list', [ '@list' => formatOutputText($fields_displayed['publish_on']), ]); } if (isset($fields_displayed['unpublish_on'])) { $output[] = $this->t('Unpublish On field displayed for: @list', [ '@list' => formatOutputText($fields_displayed['unpublish_on']), ]); } if (isset($fields_hidden['publish_on'])) { $output[] = $this->t('Publish On field hidden for: @list', [ '@list' => formatOutputText($fields_hidden['publish_on']), ]); } if (isset($fields_hidden['unpublish_on'])) { $output[] = $this->t('Unpublish On field hidden for: @list', [ '@list' => formatOutputText($fields_hidden['unpublish_on']), ]); } return $output; } } src/SchedulerPluginBase.php +8 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\scheduler; use Drupal\Core\Entity\EntityDisplayRepositoryInterface; use Drupal\Core\Plugin\PluginBase; use Symfony\Component\DependencyInjection\ContainerInterface; Loading Loading @@ -258,4 +259,11 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin return array_unique($ids); } /** * Return all supported entity form display modes. */ public function entityFormDisplayModes() { return [EntityDisplayRepositoryInterface::DEFAULT_DISPLAY_MODE]; } } src/SchedulerPluginInterface.php +17 −0 Original line number Diff line number Diff line Loading @@ -128,4 +128,21 @@ interface SchedulerPluginInterface { */ public function entityTypeFormIds(); /** * Return all supported entity edit form display modes. * * \Drupal\Core\Entity\EntityDisplayRepositoryInterface::DEFAULT_DISPLAY_MODE * is the 'default' display mode and this is always supported. If there are no * other supported modes then this function does not need to be implemented in * the plugin. However if additional form display modes are provided by other * modules and Scheduler has been updated to support these modes for editting * the entity, then the plugin implementaion of this function should return * all supported modes including 'default'. The implementation does not need * to check if the third-party module is actually available or enabled. * * @return array * A list of entity form display mode ids. */ public function entityFormDisplayModes(); } Loading
scheduler.install +12 −0 Original line number Diff line number Diff line Loading @@ -250,3 +250,15 @@ function scheduler_update_8207() { return t('No update required.'); } } /** * Show/hide entity form fields to match Scheduling enabled/disabled settings. */ function scheduler_update_8208() { if ($result = \Drupal::service('scheduler.manager')->resetFormDisplayFields()) { return implode('</li><li>', $result); } else { return t('No update required.'); } }
scheduler.module +65 −4 Original line number Diff line number Diff line Loading @@ -534,6 +534,9 @@ function _scheduler_entity_type_form_alter(&$form, FormStateInterface $form_stat ]; $form['#entity_builders'][] = '_scheduler_form_entity_type_form_builder'; // Add a custom submit handler to adjust the fields in the form displays. $form['actions']['submit']['#submit'][] = '_scheduler_form_entity_type_submit'; } /** Loading @@ -554,6 +557,64 @@ function _scheduler_form_entity_type_form_builder($entity_type, $type, &$form, F $type->setThirdPartySetting('scheduler', 'unpublish_revision', $form_state->getValue('scheduler_unpublish_revision')); } /** * Entity type form submit handler. */ function _scheduler_form_entity_type_submit($form, FormStateInterface $form_state) { // Get the entity type id (node, media, taxonomy_term, etc.) $entity_type_id = $form_state->getFormObject()->getEntity()->getEntityType()->getBundleOf(); // Get the entity bundle id (page, article, image, etc.) $bundle_id = $form_state->getFormObject()->getEntity()->id(); /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ $display_repository = \Drupal::service('entity_display.repository'); // Get all active display modes. getFormModes() returns the additional modes // then add the default. $all_display_modes = array_keys($display_repository->getFormModes($entity_type_id)); $all_display_modes[] = $display_repository::DEFAULT_DISPLAY_MODE; $supported_display_modes = \Drupal::service('scheduler.manager')->getPlugin($entity_type_id)->entityFormDisplayModes(); // Each of the active form display modes may need to be adjusted to add or // remove the scheduler fields depending on the 'enable' setting. foreach ($all_display_modes as $display_mode) { $form_display = $display_repository->getFormDisplay($entity_type_id, $bundle_id, $display_mode); // If this bundle is not enabled for scheduled publishing or the form // display mode is not supported then make sure the publish_on field is // disabled in the form display. if (!$form_state->getValue('scheduler_publish_enable') || !in_array($display_mode, $supported_display_modes)) { $form_display->removeComponent('publish_on')->save(); } // @todo Find a more robust way to detect that the checkbox was off before. elseif (!$form['scheduler']['publish']['scheduler_publish_enable']['#default_value']) { // If the entity bundle is now enabled for scheduled publishing but was // not enabled before then set the publish_on field to be displayed and // set the widget type to 'datetime_timestamp_no_default'. Only do this // when the checkbox has been changed, because the widget could be altered // or the field moved by a subsequent process or manually by admin. $form_display->setComponent('scheduler_settings', ['weight' => 50]) ->setComponent('publish_on', ['type' => 'datetime_timestamp_no_default', 'weight' => 52])->save(); } // Do the same for the unpublish_on field. if (!$form_state->getValue('scheduler_unpublish_enable') || !in_array($display_mode, $supported_display_modes)) { $form_display->removeComponent('unpublish_on')->save(); } elseif (!$form['scheduler']['unpublish']['scheduler_unpublish_enable']['#default_value']) { $form_display->setComponent('scheduler_settings', ['weight' => 50]) ->setComponent('unpublish_on', ['type' => 'datetime_timestamp_no_default', 'weight' => 54])->save(); } // If the display mode is not supported then also remove the // scheduler_settings group fieldset. if (!in_array($display_mode, $supported_display_modes)) { $form_display->removeComponent('scheduler_settings')->save(); } } } /** * Form alter handling for Devel Generate forms. */ Loading Loading @@ -699,7 +760,7 @@ function scheduler_entity_base_field_info(EntityTypeInterface $entity_type) { ->setLabel(t('Publish on')) ->setDisplayOptions('form', [ 'type' => 'datetime_timestamp_no_default', 'weight' => 30, 'region' => 'hidden', ]) ->setDisplayConfigurable('form', TRUE) ->setTranslatable(TRUE) Loading @@ -710,7 +771,7 @@ function scheduler_entity_base_field_info(EntityTypeInterface $entity_type) { ->setLabel(t('Unpublish on')) ->setDisplayOptions('form', [ 'type' => 'datetime_timestamp_no_default', 'weight' => 30, 'region' => 'hidden', ]) ->setDisplayConfigurable('form', TRUE) ->setTranslatable(TRUE) Loading Loading @@ -1016,11 +1077,11 @@ function scheduler_entity_extra_field_info() { $unpublishing_enabled = $type->getThirdPartySetting('scheduler', 'unpublish_enable', $config->get('default_unpublish_enable')); if ($publishing_enabled || $unpublishing_enabled) { // Weight 20 puts this below the core fields by default. // Weight 50 puts this below the core fields by default. $fields[$entityTypeId][$type->id()]['form']['scheduler_settings'] = [ 'label' => t('Scheduler Dates'), 'description' => t('Fieldset containing Scheduler Publish-on and Unpublish-on date input fields'), 'weight' => 20, 'weight' => 50, ]; } } Loading
src/SchedulerManager.php +124 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Link; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Url; use Psr\Log\LoggerInterface; Loading Loading @@ -1336,4 +1337,127 @@ class SchedulerManager { return $output; } /** * Reset the form display fields to match the Scheduler enabled settings. * * The Scheduler fields are disabled by default and only enabled in a form * display when that entity bundle is enabled for scheduled publishing or * unpublishing. See _scheduler_form_entity_type_submit() for details. * * This was a design change during the development of Scheduler 2.0 and any * site that had installed Scheduler prior to 2.0-rc8 will have all fields * enabled. Whilst this should not be a problem, it is preferrable to update * the displays to match the scenario when the modules is freshly installed. * Hence this function was added and called from scheduler_update_8208(). */ public function resetFormDisplayFields() { /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ $display_repository = \Drupal::service('entity_display.repository'); $fields_displayed = []; $fields_hidden = []; foreach ($this->getPlugins() as $entityTypeId => $plugin) { // Get all active display modes. getFormModes() returns the additional // modes then add the default. $all_display_modes = array_keys($display_repository->getFormModes($entityTypeId)); $all_display_modes[] = $display_repository::DEFAULT_DISPLAY_MODE; $supported_display_modes = $plugin->entityFormDisplayModes(); $bundles = $plugin->getTypes(); foreach ($bundles as $bundle_id => $bundle) { foreach ($all_display_modes as $display_mode) { $form_display = $display_repository->getFormDisplay($entityTypeId, $bundle_id, $display_mode); foreach (['publish', 'unpublish'] as $value) { $field = $value . '_on'; $setting = $value . '_enable'; // If this bundle is not enabled for scheduled (un)publishing or the // form display mode is not supported then remove the field. if (!$bundle->getThirdPartySetting('scheduler', $setting, FALSE) || !in_array($display_mode, $supported_display_modes)) { $form_display->removeComponent($field)->save(); if ($display_mode == $display_repository::DEFAULT_DISPLAY_MODE) { $fields_hidden[$field]["{$bundle->getEntityType()->getCollectionLabel()}"][] = $bundle->label(); } } else { // Scheduling is enabled. Get the existing component to preserve // any changed settings, but if the type is empty or set the to // the core default 'datetime_timestamp' then change it to // Scheduler's 'datetime_timestamp_no_default'. $component = $form_display->getComponent($field); if (empty($component['type']) || $component['type'] == 'datetime_timestamp') { $component['type'] = 'datetime_timestamp_no_default'; } $component['weight'] = ($field == 'publish_on' ? 52 : 54); // Make sure the field and the settings group are displayed. $form_display->setComponent('scheduler_settings', ['weight' => 50]) ->setComponent($field, $component)->save(); if ($display_mode == $display_repository::DEFAULT_DISPLAY_MODE) { $fields_displayed[$field]["{$bundle->getEntityType()->getCollectionLabel()}"][] = $bundle->label(); } } } // If the display mode is not supported remove the group fieldset. if (!in_array($display_mode, $supported_display_modes)) { $form_display->removeComponent('scheduler_settings')->save(); } } } } // It is not possible to determine whether a field on an enabled entity type // had been manually hidden before this update. It is a rare scenario but // inform the admin that there is potentially some manual work to do. $uri = 'https://www.drupal.org/project/scheduler/issues/3320341'; $link = Link::fromTextAndUrl($this->t('Scheduler issue 3320341'), Url::fromUri($uri)); \Drupal::messenger()->addMessage($this->t( 'The Scheduler fields are now hidden by default and automatically changed to be displayed when an entity bundle is enabled for scheduling. If you have previously manually hidden scheduler fields for enabled entity types then these fields will now be displayed. You will need to manually hide them again or implement hook_scheduler_hide_publish_date() or hook_scheduler_{TYPE}_hide_publish_date() and the equivalent for unpublish_date. See @issue for details.', ['@issue' => $link->toString()]), MessengerInterface::TYPE_STATUS, FALSE); $this->logger->warning( 'The Scheduler fields are now hidden by default and automatically changed to be displayed when an entity bundle is enabled for scheduling. If you have previously manually hidden scheduler fields for enabled entity types then these fields will now be displayed. You will need to manually hide them again or implement hook_scheduler_hide_publish_date() or hook_scheduler_{TYPE}_hide_publish_date() and the equivalent for unpublish_date. See @issue for details.', ['@issue' => $link->toString(), 'link' => $link->toString()] ); /** * Helper function to format the list of fields on bundles. */ function formatOutputText($fields) { return implode(', ', array_map(function ($name, $bundles) { return "$name (" . implode(',', $bundles) . ")"; }, array_keys($fields), $fields)); } $output = []; if (isset($fields_displayed['publish_on'])) { $output[] = $this->t('Publish On field displayed for: @list', [ '@list' => formatOutputText($fields_displayed['publish_on']), ]); } if (isset($fields_displayed['unpublish_on'])) { $output[] = $this->t('Unpublish On field displayed for: @list', [ '@list' => formatOutputText($fields_displayed['unpublish_on']), ]); } if (isset($fields_hidden['publish_on'])) { $output[] = $this->t('Publish On field hidden for: @list', [ '@list' => formatOutputText($fields_hidden['publish_on']), ]); } if (isset($fields_hidden['unpublish_on'])) { $output[] = $this->t('Unpublish On field hidden for: @list', [ '@list' => formatOutputText($fields_hidden['unpublish_on']), ]); } return $output; } }
src/SchedulerPluginBase.php +8 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\scheduler; use Drupal\Core\Entity\EntityDisplayRepositoryInterface; use Drupal\Core\Plugin\PluginBase; use Symfony\Component\DependencyInjection\ContainerInterface; Loading Loading @@ -258,4 +259,11 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin return array_unique($ids); } /** * Return all supported entity form display modes. */ public function entityFormDisplayModes() { return [EntityDisplayRepositoryInterface::DEFAULT_DISPLAY_MODE]; } }
src/SchedulerPluginInterface.php +17 −0 Original line number Diff line number Diff line Loading @@ -128,4 +128,21 @@ interface SchedulerPluginInterface { */ public function entityTypeFormIds(); /** * Return all supported entity edit form display modes. * * \Drupal\Core\Entity\EntityDisplayRepositoryInterface::DEFAULT_DISPLAY_MODE * is the 'default' display mode and this is always supported. If there are no * other supported modes then this function does not need to be implemented in * the plugin. However if additional form display modes are provided by other * modules and Scheduler has been updated to support these modes for editting * the entity, then the plugin implementaion of this function should return * all supported modes including 'default'. The implementation does not need * to check if the third-party module is actually available or enabled. * * @return array * A list of entity form display mode ids. */ public function entityFormDisplayModes(); }