diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php index c55f044..ebaf19b 100644 --- a/core/lib/Drupal/Core/Form/FormBuilder.php +++ b/core/lib/Drupal/Core/Form/FormBuilder.php @@ -551,7 +551,7 @@ public function processForm($form_id, &$form, &$form_state) { } if (!$form_state['rebuild'] && !$this->formValidator->getAnyErrors()) { - if ($submit_response = $this->formSubmitter->handleFormSubmission($form, $form_state)) { + if ($submit_response = $this->formSubmitter->doSubmitForm($form, $form_state)) { return $submit_response; } } @@ -764,8 +764,8 @@ public function executeSubmitHandlers(&$form, &$form_state) { /** * {@inheritdoc} */ - public function handleFormSubmission(&$form, &$form_state) { - return $this->formSubmitter->handleFormSubmission($form, $form_state); + public function doSubmitForm(&$form, &$form_state) { + throw new \LogicException('Use FormBuilderInterface::processForm() instead.'); } /** diff --git a/core/lib/Drupal/Core/Form/FormSubmitter.php b/core/lib/Drupal/Core/Form/FormSubmitter.php index 17b1d94..fea8f54 100644 --- a/core/lib/Drupal/Core/Form/FormSubmitter.php +++ b/core/lib/Drupal/Core/Form/FormSubmitter.php @@ -47,7 +47,7 @@ public function __construct(RequestStack $request_stack, UrlGeneratorInterface $ /** * {@inheritdoc} */ - public function handleFormSubmission(&$form, &$form_state) { + public function doSubmitForm(&$form, &$form_state) { if (!$form_state['submitted']) { return; } diff --git a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php index bba3836..8ae8b08 100644 --- a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php +++ b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php @@ -24,7 +24,7 @@ * If a response was set by a submit handler, or if the form needs to * redirect, a Response object will be returned. */ - public function handleFormSubmission(&$form, &$form_state); + public function doSubmitForm(&$form, &$form_state); /** * Executes custom submission handlers for a given form. diff --git a/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php b/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php index 4082c9f..5dcc668 100644 --- a/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php +++ b/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php @@ -51,20 +51,20 @@ public function setUp() { } /** - * @covers ::handleFormSubmission + * @covers ::doSubmitForm */ public function testHandleFormSubmissionNotSubmitted() { $form_submitter = $this->getFormSubmitter(); $form = array(); $form_state = $this->getFormStateDefaults(); - $return = $form_submitter->handleFormSubmission($form, $form_state); + $return = $form_submitter->doSubmitForm($form, $form_state); $this->assertFalse($form_state['executed']); $this->assertNull($return); } /** - * @covers ::handleFormSubmission + * @covers ::doSubmitForm */ public function testHandleFormSubmissionNoRedirect() { $form_submitter = $this->getFormSubmitter(); @@ -73,13 +73,13 @@ public function testHandleFormSubmissionNoRedirect() { $form_state['submitted'] = TRUE; $form_state['no_redirect'] = TRUE; - $return = $form_submitter->handleFormSubmission($form, $form_state); + $return = $form_submitter->doSubmitForm($form, $form_state); $this->assertTrue($form_state['executed']); $this->assertNull($return); } /** - * @covers ::handleFormSubmission + * @covers ::doSubmitForm * * @dataProvider providerTestHandleFormSubmissionWithResponses */ @@ -97,7 +97,7 @@ public function testHandleFormSubmissionWithResponses($class, $form_state_key) { $form_submitter = $this->getFormSubmitter(); $form = array(); - $return = $form_submitter->handleFormSubmission($form, $form_state); + $return = $form_submitter->doSubmitForm($form, $form_state); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $return); }