Commit 7f8b4d57 authored by Joël Pittet's avatar Joël Pittet
Browse files

Partial revert to align with 8.x-3.x "Issue #2992362 by thalles, Daniel Korte,...

Partial revert to align with 8.x-3.x "Issue #2992362 by thalles, Daniel Korte, sagannotcarl, baikho, osman, japerry, stevekeiretsu: Wizards should be using PrivateTempStore not SharedTempStore, otherwise all users end up sharing the same cached form values"
parent 0601a885
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ use Drupal\Component\EventDispatcher\Event;
use Drupal\Core\Block\BlockPluginInterface;
use Drupal\ctools\Plugin\BlockVariantInterface;


/**
 *
 */
+1 −1
Original line number Diff line number Diff line
@@ -44,8 +44,8 @@ abstract class EntityFormWizardBase extends FormWizardBase implements EntityForm
   *   The current active step of the wizard.
   */
  public function __construct(SharedTempStoreFactory $tempstore, FormBuilderInterface $builder, ClassResolverInterface $class_resolver, EventDispatcherInterface $event_dispatcher, RouteMatchInterface $route_match, RendererInterface $renderer, $tempstore_id, EntityTypeManagerInterface $entity_type_manager, $machine_name = NULL, $step = NULL) {
    $this->entityTypeManager = $entity_type_manager;
    parent::__construct($tempstore, $builder, $class_resolver, $event_dispatcher, $route_match, $renderer, $tempstore_id, $machine_name, $step);
    $this->entityTypeManager = $entity_type_manager;
  }

  /**
+5 −16
Original line number Diff line number Diff line
@@ -90,10 +90,11 @@ abstract class FormWizardBase extends FormBase implements FormWizardInterface {
   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
   *   The event dispatcher.
   * @param $tempstore_id
   *   The private temp store factory collection name.
   * @param string $machine_name
   *   The PrivateTempStore key for our current wizard values.
   * @param string $step
   *   The shared temp store factory collection name.
   * @param null $machine_name
   *   The SharedTempStore key for our current wizard values.
   * @param null $step
>>>>>>> parent of f243a856 (Issue #2992362 by thalles, Daniel Korte, sagannotcarl, baikho, osman, japerry, stevekeiretsu: Wizards should be using PrivateTempStore not SharedTempStore, otherwise all users end up sharing the same cached form values)
   *   The current active step of the wizard.
   */
  public function __construct(SharedTempStoreFactory $tempstore, FormBuilderInterface $builder, ClassResolverInterface $class_resolver, EventDispatcherInterface $event_dispatcher, RouteMatchInterface $route_match, RendererInterface $renderer, $tempstore_id, $machine_name = NULL, $step = NULL) {
@@ -448,9 +449,6 @@ abstract class FormWizardBase extends FormBase implements FormWizardInterface {
    return $actions;
  }

  /**
   *
   */
  public function ajaxSubmit(array $form, FormStateInterface $form_state) {
    $cached_values = $form_state->getTemporaryValue('wizard');
    $response = new AjaxResponse();
@@ -459,9 +457,6 @@ abstract class FormWizardBase extends FormBase implements FormWizardInterface {
    return $response;
  }

  /**
   *
   */
  public function ajaxPrevious(array $form, FormStateInterface $form_state) {
    $cached_values = $form_state->getTemporaryValue('wizard');
    $response = new AjaxResponse();
@@ -470,18 +465,12 @@ abstract class FormWizardBase extends FormBase implements FormWizardInterface {
    return $response;
  }

  /**
   *
   */
  public function ajaxFinish(array $form, FormStateInterface $form_state) {
    $response = new AjaxResponse();
    $response->addCommand(new CloseModalDialogCommand());
    return $response;
  }

  /**
   *
   */
  public function getRouteName() {
    return $this->routeMatch->getRouteName();
  }