isRedirectDisabled example

->shouldBeCalled();

    $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->disableRedirect($no_redirect));
  }

  /** * @covers ::isRedirectDisabled * * @dataProvider providerSingleBooleanArgument */
  public function testIsRedirectDisabled($no_redirect) {
    $this->decoratedFormState->isRedirectDisabled()
      ->willReturn($no_redirect)
      ->shouldBeCalled();

    $this->assertSame($no_redirect$this->formStateDecoratorBase->isRedirectDisabled());
  }

  /** * @covers ::setProcessInput * * @dataProvider providerSingleBooleanArgument */
  

  protected function ajaxFormWrapper($form_class, FormStateInterface &$form_state) {
    /** @var \Drupal\Core\Render\RendererInterface $renderer */
    $renderer = \Drupal::service('renderer');

    // This won't override settings already in.     if (!$form_state->has('rerender')) {
      $form_state->set('rerender', FALSE);
    }
    $ajax = $form_state->get('ajax');
    // Do not overwrite if the redirect has been disabled.     if (!$form_state->isRedirectDisabled()) {
      $form_state->disableRedirect($ajax);
    }
    $form_state->disableCache();

    // Builds the form in a render context in order to ensure that cacheable     // metadata is bubbled up.     $render_context = new RenderContext();
    $callable = function D) use ($form_class, &$form_state) {
      return \Drupal::formBuilder()->buildForm($form_class$form_state);
    };
    $form = $renderer->executeInRenderContext($render_context$callable);

    
public function getRedirect() {
    // Skip redirection for form submissions invoked via     // \Drupal\Core\Form\FormBuilderInterface::submitForm().     if ($this->isProgrammed()) {
      return FALSE;
    }
    // Skip redirection if rebuild is activated.     if ($this->isRebuilding()) {
      return FALSE;
    }
    // Skip redirection if it was explicitly disallowed.     if ($this->isRedirectDisabled()) {
      return FALSE;
    }

    return $this->redirect;
  }

  /** * Sets the global status of errors. * * @param bool $errors * TRUE if any form has any errors, FALSE otherwise. */

  public function disableRedirect($no_redirect = TRUE) {
    $this->decoratedFormState->disableRedirect($no_redirect);

    return $this;
  }

  /** * {@inheritdoc} */
  public function isRedirectDisabled() {
    return $this->decoratedFormState->isRedirectDisabled();
  }

  /** * {@inheritdoc} */
  public function setProcessInput($process_input = TRUE) {
    $this->decoratedFormState->setProcessInput($process_input);

    return $this;
  }

  

        }
      }

      $form_item_name = static::mapPairViolationPropertyPathsToFormNames($violation->getPropertyPath()$form);
      // When adding a toolbar item, it is possible that not all conditions for       // using it have been met yet. FormBuilder refuses to rebuild forms when a       // validation error is present. But to meet the condition for the toolbar       // item, configuration must be set in a vertical tab that must still       // appear. Work-around: reduce the validation error to a warning message.       // @see \Drupal\ckeditor5\Plugin\Validation\Constraint\ToolbarItemConditionsMetConstraintValidator       if ($form_state->isRedirectDisabled() && $form_item_name === 'editor][settings][toolbar][items') {
        $this->messenger()->addWarning($violation->getMessage());
        continue;
      }
      $form_state->getCompleteFormState()->setErrorByName($form_item_name$violation->getMessage());
    }

    // Pass it on to ::submitConfigurationForm().     $form_state->get('editor')->setSettings($settings);

    // Provide the validated eventual pair in form state to     // ::getGeneratedAllowedHtmlValue(), to update filter_html's
Home | Imprint | This part of the site doesn't use cookies.