Loading core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php +2 −2 Changes for core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ public function getFormId() { * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { $count = \Drupal::state()->get('search_embedded_form.submit_count'); $count = \Drupal::state()->get('search_embedded_form.submit_count', 0); $form['name'] = [ '#type' => 'textfield', Loading @@ -48,7 +48,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { $state = \Drupal::state(); $submit_count = (int) $state->get('search_embedded_form.submit_count'); $submit_count = $state->get('search_embedded_form.submit_count', 0); $state->set('search_embedded_form.submit_count', $submit_count + 1); $this->messenger()->addStatus($this->t('Test form was submitted')); } Loading Loading
core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php +2 −2 Changes for core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ public function getFormId() { * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { $count = \Drupal::state()->get('search_embedded_form.submit_count'); $count = \Drupal::state()->get('search_embedded_form.submit_count', 0); $form['name'] = [ '#type' => 'textfield', Loading @@ -48,7 +48,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { $state = \Drupal::state(); $submit_count = (int) $state->get('search_embedded_form.submit_count'); $submit_count = $state->get('search_embedded_form.submit_count', 0); $state->set('search_embedded_form.submit_count', $submit_count + 1); $this->messenger()->addStatus($this->t('Test form was submitted')); } Loading