Skip to content
Snippets Groups Projects
Unverified Commit de09969b authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3033900 by pcambra: Fix documentation on field_ui.api.php

parent 3f9f063d
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -17,7 +17,7 @@
* The instantiated field formatter plugin.
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
* The field definition.
* @param $view_mode
* @param string $view_mode
* The entity view mode.
* @param array $form
* The (entire) configuration form array.
......@@ -27,9 +27,9 @@
* @return array
* Returns the form array to be built.
*
* @see \Drupal\field_ui\DisplayOverView
* @see \Drupal\field_ui\Form\EntityViewDisplayEditForm::thirdPartySettingsForm()
*/
function hook_field_formatter_third_party_settings_form(\Drupal\Core\Field\FormatterInterface $plugin, \Drupal\Core\Field\FieldDefinitionInterface $field_definition, $view_mode, $form, \Drupal\Core\Form\FormStateInterface $form_state) {
function hook_field_formatter_third_party_settings_form(\Drupal\Core\Field\FormatterInterface $plugin, \Drupal\Core\Field\FieldDefinitionInterface $field_definition, $view_mode, array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
$element = [];
// Add a 'my_setting' checkbox to the settings form for 'foo_formatter' field
// formatters.
......@@ -50,7 +50,7 @@ function hook_field_formatter_third_party_settings_form(\Drupal\Core\Field\Forma
* The instantiated field widget plugin.
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
* The field definition.
* @param $form_mode
* @param string $form_mode
* The entity form mode.
* @param array $form
* The (entire) configuration form array.
......@@ -60,9 +60,9 @@ function hook_field_formatter_third_party_settings_form(\Drupal\Core\Field\Forma
* @return array
* Returns the form array to be built.
*
* @see \Drupal\field_ui\FormDisplayOverView
* @see \Drupal\field_ui\Form\EntityFormDisplayEditForm::thirdPartySettingsForm()
*/
function hook_field_widget_third_party_settings_form(\Drupal\Core\Field\WidgetInterface $plugin, \Drupal\Core\Field\FieldDefinitionInterface $field_definition, $form_mode, $form, \Drupal\Core\Form\FormStateInterface $form_state) {
function hook_field_widget_third_party_settings_form(\Drupal\Core\Field\WidgetInterface $plugin, \Drupal\Core\Field\FieldDefinitionInterface $field_definition, $form_mode, array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
$element = [];
// Add a 'my_setting' checkbox to the settings form for 'foo_widget' field
// widgets.
......@@ -81,15 +81,15 @@ function hook_field_widget_third_party_settings_form(\Drupal\Core\Field\WidgetIn
*
* @param array $summary
* An array of summary messages.
* @param $context
* @param array $context
* An associative array with the following elements:
* - formatter: The formatter object.
* - formatter: The formatter plugin.
* - field_definition: The field definition.
* - view_mode: The view mode being configured.
*
* @see \Drupal\field_ui\DisplayOverView
* @see \Drupal\field_ui\Form\EntityViewDisplayEditForm::alterSettingsSummary()
*/
function hook_field_formatter_settings_summary_alter(&$summary, $context) {
function hook_field_formatter_settings_summary_alter(array &$summary, array $context) {
// Append a message to the summary when an instance of foo_formatter has
// mysetting set to TRUE for the current view mode.
if ($context['formatter']->getPluginId() == 'foo_formatter') {
......@@ -110,9 +110,9 @@ function hook_field_formatter_settings_summary_alter(&$summary, $context) {
* - field_definition: The field definition.
* - form_mode: The form mode being configured.
*
* @see \Drupal\field_ui\FormDisplayOverView
* @see \Drupal\field_ui\Form\EntityFormDisplayEditForm::alterSettingsSummary()
*/
function hook_field_widget_settings_summary_alter(&$summary, $context) {
function hook_field_widget_settings_summary_alter(array &$summary, array $context) {
// Append a message to the summary when an instance of foo_widget has
// mysetting set to TRUE for the current view mode.
if ($context['widget']->getPluginId() == 'foo_widget') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment