Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#5 | editor_forms-2077973-5.patch | 2.13 KB | plopesc |
#3 | editor_forms-2077973-3.patch | 5.76 KB | plopesc |
#3 | interdiff.txt | 485 bytes | plopesc |
#1 | editor_forms-2077973-1.patch | 5.76 KB | plopesc |
Comments
Comment #1
plopescHello
With this patch, editor module forms inherits from
FormBase
and removed usages oft()
, replaced by$this->t()
.Regards.
Comment #2
Wim LeersJust one minor nitpick:
Extraneous newline.
Comment #3
plopescRemoving empty line...
Comment #4
Wim LeersLooks 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.
Comment #5
plopescRe-rolling once #2027181: Use a CKEditor Widget to create a stellar UX for captioning and aligning images has been committed.
Comment #6
Wim LeersCode looks good. Makes
EditorLinkDialog
's code look likeEditorImageDialog
's (see #4).Manually tested, all continues to work well.
RTBC.
Comment #7
webchickCommitted and pushed to 8.x. Thanks!