diff --git a/core/modules/path/lib/Drupal/path/Plugin/Field/FieldWidget/PathWidget.php b/core/modules/path/lib/Drupal/path/Plugin/Field/FieldWidget/PathWidget.php index 6730a88..bf49d0e 100644 --- a/core/modules/path/lib/Drupal/path/Plugin/Field/FieldWidget/PathWidget.php +++ b/core/modules/path/lib/Drupal/path/Plugin/Field/FieldWidget/PathWidget.php @@ -59,16 +59,30 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen '#maxlength' => 255, '#description' => t('The alternative URL for this content. Use a relative path without a trailing slash. For example, enter "about" for the about page.'), ); - $element['pid'] = array('#type' => 'value', '#value' => $path['pid']); - $element['source'] = array('#type' => 'value', '#value' => $path['source']); - $element['langcode'] = array('#type' => 'value', '#value' => $path['langcode']); + $element['pid'] = array( + '#type' => 'value', + '#value' => $path['pid'], + ); + $element['source'] = array( + '#type' => 'value', + '#value' => $path['source'], + ); + $element['langcode'] = array( + '#type' => 'value', + '#value' => $path['langcode'], + ); return $element; } /** * Form element validation handler for URL alias form element. + * + * @param array $element + * The form element. + * @param array $form_state + * The form state. */ - public static function validateFormElement(&$element, &$form_state) { + public static function validateFormElement(array &$element, array &$form_state) { if (!empty($element['alias']['#value'])) { // Trim the submitted value. $alias = trim($element['alias']['#value']);