Loading entity_form_steps.install +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ /** * @file * Install, update, and uninstall functions for the Entity Form Steps module. * Install, update, and uninstall functions. */ /** Loading entity_form_steps.module +0 −20 Original line number Diff line number Diff line Loading @@ -7,8 +7,6 @@ use Drupal\Core\Entity\ContentEntityFormInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Url; use Drupal\entity_form_steps\Form\EntityFormSteps; /** Loading Loading @@ -63,21 +61,3 @@ function _entity_form_steps_form_entity_display_form_validate($form, FormStateIn } $formState->setValue('fields', $fields); } /** * Implements hook_help(). */ function entity_form_steps_help($route_name, RouteMatchInterface $route_match): string { $build = []; if ($route_name === 'help.page.entity_form_steps') { $build[] = [ '#markup' => '<h2>' . t('Documentation') . '</h2>', ]; $build[] = [ '#type' => 'link', '#title' => 'https://git.drupalcode.org/project/entity_form_steps/-/blob/1.x/README.md', '#url' => Url::fromUri('https://git.drupalcode.org/project/entity_form_steps/-/blob/1.x/README.md'), ]; } return \Drupal::service('renderer')->render($build); } src/Form/EntityFormSteps.php +2 −6 Original line number Diff line number Diff line Loading @@ -22,8 +22,6 @@ class EntityFormSteps { * Returns an array of ordered steps. */ public static function getSteps(FormStateInterface $formState): array { /** @var \Drupal\Core\Entity\ContentEntityForm $formObject */ $formObject = $formState->getFormObject(); /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $formDisplay */ $formDisplay = $formState->getStorage()['form_display']; Loading @@ -33,7 +31,7 @@ class EntityFormSteps { uasort($steps, [SortArray::class, 'sortByWeightElement']); if ($steps) { $entity = $formObject->getEntity(); $entity = $formState->getFormObject()->getEntity(); // Invoke hook_entity_form_steps_alter(). \Drupal::moduleHandler()->invokeAll( "entity_form_steps_alter", Loading Loading @@ -223,9 +221,7 @@ class EntityFormSteps { * Returns a URL. */ public static function getCancelUrl(array $state, FormStateInterface $formState): Url { /** @var \Drupal\Core\Entity\ContentEntityForm $formObject */ $formObject = $formState->getFormObject(); $entity = $formObject->getEntity(); $entity = $formState->getFormObject()->getEntity(); $step = $state['steps'][$state['current_step']]; // Redirect to specified route if configured. Loading Loading
entity_form_steps.install +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ /** * @file * Install, update, and uninstall functions for the Entity Form Steps module. * Install, update, and uninstall functions. */ /** Loading
entity_form_steps.module +0 −20 Original line number Diff line number Diff line Loading @@ -7,8 +7,6 @@ use Drupal\Core\Entity\ContentEntityFormInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Url; use Drupal\entity_form_steps\Form\EntityFormSteps; /** Loading Loading @@ -63,21 +61,3 @@ function _entity_form_steps_form_entity_display_form_validate($form, FormStateIn } $formState->setValue('fields', $fields); } /** * Implements hook_help(). */ function entity_form_steps_help($route_name, RouteMatchInterface $route_match): string { $build = []; if ($route_name === 'help.page.entity_form_steps') { $build[] = [ '#markup' => '<h2>' . t('Documentation') . '</h2>', ]; $build[] = [ '#type' => 'link', '#title' => 'https://git.drupalcode.org/project/entity_form_steps/-/blob/1.x/README.md', '#url' => Url::fromUri('https://git.drupalcode.org/project/entity_form_steps/-/blob/1.x/README.md'), ]; } return \Drupal::service('renderer')->render($build); }
src/Form/EntityFormSteps.php +2 −6 Original line number Diff line number Diff line Loading @@ -22,8 +22,6 @@ class EntityFormSteps { * Returns an array of ordered steps. */ public static function getSteps(FormStateInterface $formState): array { /** @var \Drupal\Core\Entity\ContentEntityForm $formObject */ $formObject = $formState->getFormObject(); /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $formDisplay */ $formDisplay = $formState->getStorage()['form_display']; Loading @@ -33,7 +31,7 @@ class EntityFormSteps { uasort($steps, [SortArray::class, 'sortByWeightElement']); if ($steps) { $entity = $formObject->getEntity(); $entity = $formState->getFormObject()->getEntity(); // Invoke hook_entity_form_steps_alter(). \Drupal::moduleHandler()->invokeAll( "entity_form_steps_alter", Loading Loading @@ -223,9 +221,7 @@ class EntityFormSteps { * Returns a URL. */ public static function getCancelUrl(array $state, FormStateInterface $formState): Url { /** @var \Drupal\Core\Entity\ContentEntityForm $formObject */ $formObject = $formState->getFormObject(); $entity = $formObject->getEntity(); $entity = $formState->getFormObject()->getEntity(); $step = $state['steps'][$state['current_step']]; // Redirect to specified route if configured. Loading