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.
Problem/Motivation
API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Form%21fo...
> By default, when \Drupal::formBuilder()->getForm() is called, Drupal looks for a function with the same name as the form ID, and uses that function to build the form. In contrast, base forms allow multiple form IDs to be mapped to a single base (also called 'factory') form function.
This is D7-era stuff. getForm() now receives either the name of a class or an instance.
Steps to reproduce
Proposed resolution
Read the method and update the docs
Remaining tasks
Patch
Review
Commit
Comments
Comment #13
quietone CreditAttribution: quietone at PreviousNext commentedThis was an issue at a documentation triage meeting.
The documentation has been updated in #2366589: Move form-related hooks from system.api.php to form.api.php, and #2842141: Document that more specific hooks might be called before the primary hook depending on the module names but the point made in the IS has not been addressed. It is a bug because it is incorrect documentation.