Issue #1650198 by apaderno, quietone, jhodgdon, smustgrave: Remove references to node_edit in FormBuilderInterface
parent
bf4dfeaaca
commit
2e311a8d3f
|
@ -49,10 +49,10 @@ interface FormBuilderInterface {
|
||||||
* @param mixed ...$args
|
* @param mixed ...$args
|
||||||
* Additional arguments are passed on to the functions called by
|
* Additional arguments are passed on to the functions called by
|
||||||
* \Drupal::formBuilder()->getForm(), including the unique form constructor
|
* \Drupal::formBuilder()->getForm(), including the unique form constructor
|
||||||
* function. For example, the node_edit form requires that a node object is
|
* function. For example, the node preview form requires that a node object
|
||||||
* passed in here when it is called. These are available to implementations
|
* is passed in here when it is called. These are available to
|
||||||
* of hook_form_alter() and hook_form_FORM_ID_alter() as the array
|
* implementations of hook_form_alter() and hook_form_FORM_ID_alter() as the
|
||||||
* $form_state->getBuildInfo()['args'].
|
* array $form_state->getBuildInfo()['args'].
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
* The form array.
|
* The form array.
|
||||||
|
@ -159,18 +159,12 @@ interface FormBuilderInterface {
|
||||||
* \Drupal::request()->request entry, include the key, but set the value to
|
* \Drupal::request()->request entry, include the key, but set the value to
|
||||||
* NULL.
|
* NULL.
|
||||||
* @param mixed ...$args
|
* @param mixed ...$args
|
||||||
* Additional arguments are passed on to the functions called by
|
* Arguments that need to be passed by reference should not be included
|
||||||
* self::submitForm(), including the unique form constructor function.
|
* here, but rather placed directly in the $form_state build info array so
|
||||||
* For example, the node_edit form requires that a node object be passed
|
* that the reference can be preserved. For example, a form whose ID is
|
||||||
* in here when it is called. Arguments that need to be passed by reference
|
* my_module_form, built from a class for which its buildForm() method
|
||||||
* should not be included here, but rather placed directly in the
|
* expects a &$object argument would be called via self::submitForm() as
|
||||||
* $form_state build info array so that the reference can be preserved. For
|
* follows:
|
||||||
* example, a form builder function with the following signature:
|
|
||||||
* @code
|
|
||||||
* function my_module_form($form, FormStateInterface &$form_state, &$object) {
|
|
||||||
* }
|
|
||||||
* @endcode
|
|
||||||
* would be called via self::submitForm() as follows:
|
|
||||||
* @code
|
* @code
|
||||||
* $form_state->setValues($my_form_values);
|
* $form_state->setValues($my_form_values);
|
||||||
* $form_state->addBuildInfo('args', [&$object]);
|
* $form_state->addBuildInfo('args', [&$object]);
|
||||||
|
|
Loading…
Reference in New Issue