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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plopesc’s picture

Status: Active » Needs review
FileSize
5.76 KB

Hello

With this patch, editor module forms inherits from FormBase and removed usages of t(), replaced by $this->t().

Regards.

Wim Leers’s picture

Status: Needs review » Needs work

Just one minor nitpick:

+++ b/core/modules/editor/lib/Drupal/editor/Form/EditorImageDialog.php
@@ -7,19 +7,18 @@
+

Extraneous newline.

plopesc’s picture

Status: Needs work » Needs review
FileSize
485 bytes
5.76 KB

Removing empty line...

Wim Leers’s picture

Status: Needs review » Postponed

Looks good to go, but this will conflict with #2027181: Use a CKEditor Widget to create a stellar UX for captioning and aligning images, which also fixes this for EditorImageDialog, which has been dragging along for months. I want to avoid yet another reroll.

So: postponing this issue on that issue. Sorry.

plopesc’s picture

Status: Postponed » Needs review
FileSize
2.13 KB
Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Code looks good. Makes EditorLinkDialog's code look like EditorImageDialog's (see #4).

Manually tested, all continues to work well.

RTBC.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.