Part of #2072251: [meta] Modernize forms to use FormBase

Updated: Comment #N

Problem/Motivation

Now that #2059245: Add a FormBase class containing useful methods is in, I was looking at old forms that have empty validateForm() methods, or still use Drupal::service() or t().

Proposed resolution

Convert existing FormInterface forms to extend FormBase

Remaining tasks

User interface changes

API changes

Comments

rosk0’s picture

Status: Active » Needs review
StatusFileSize
new1.59 KB

Initial patch.

tim.plunkett’s picture

+++ b/core/modules/system/tests/modules/ajax_test/lib/Drupal/ajax_test/AjaxTestForm.php
@@ -26,18 +26,18 @@ public function getFormID() {
-    drupal_set_title(t('Ajax Form contents'));
+    drupal_set_title($this->t('Ajax Form contents'));

You can use $form['#title'] now

rosk0’s picture

StatusFileSize
new698 bytes
new1.59 KB

Fixed.

Status: Needs review » Needs work

The last submitted patch, drupal8.ajax-system.2077955-3.patch, failed testing.

rosk0’s picture

Assigned: Unassigned » rosk0

@Tim: Patch is red. Maybe #title property not in yet?

rosk0’s picture

Status: Needs work » Needs review
Issue tags: -FormInterface, -FormBase

#3: drupal8.ajax-system.2077955-3.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +FormInterface, +FormBase

The last submitted patch, drupal8.ajax-system.2077955-3.patch, failed testing.

rosk0’s picture

Status: Needs work » Postponed
xjm’s picture

Version: 8.0.x-dev » 8.2.x-dev
Issue summary: View changes
alexpott’s picture