API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Form%21Fo...

Presumably, the returned ID should be a string that can be a valid PHP function name, since it's used in hook implementation names such as hook_form_FORM_ID_alter().

The documentation should state this restriction.

Also, is there any limit on length, for example, for use in cache IDs?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

msankhala’s picture

Status: Active » Needs review
FileSize
584 bytes

Here is a patch for this.

joachim’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed f283ab5511 to 8.6.x and 58288d21b6 to 8.5.x. Thanks!

  • alexpott committed f283ab5 on 8.6.x
    Issue #2877828 by msankhala, joachim: FormInterface::getFormId() should...

  • alexpott committed 58288d2 on 8.5.x
    Issue #2877828 by msankhala, joachim: FormInterface::getFormId() should...

Status: Fixed » Closed (fixed)

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