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.
By tim.plunkett on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
Summary
- Allows
entity_get_form()
to pass along additional information, to preserve compatibility with use cases covered bydrupal_get_form()
. - Cleans up the arguments to
entity_get_form()
andentity_form_state_defaults()
. - The $langcode argument for
entity_get_form()
can now be passed as a value in the$form_state
array.
Before
<?php
function entity_form_state_defaults(EntityInterface $entity, $operation = 'default', $langcode = NULL) { }
function entity_get_form(EntityInterface $entity, $operation = 'default', $langcode = NULL) { }
?>
After
<?php
function entity_form_state_defaults(EntityInterface $entity, $operation = 'default', array $form_state = array()) { }
function entity_get_form(EntityInterface $entity, $operation = 'default') { }
?>
Impacts:
Module developers