Commit bca416ec authored by mcdruid's avatar mcdruid Committed by bojanz

Issue #2619878 by lonalore, mcdruid, gapple: Recoverable fatal error: Argument...

Issue #2619878 by lonalore, mcdruid, gapple: Recoverable fatal error: Argument 1 passed to Drupal\\Core\\Form\\ FormState::setError() must be of the type array
parent fe9d8c91
......@@ -52,22 +52,6 @@ class AddressDefaultWidget extends WidgetBase implements ContainerFactoryPluginI
*/
protected $configFactory;
/**
* The size attributes for fields likely to be inlined.
*
* @var array
*/
protected $sizeAttributes = [
AddressField::ADMINISTRATIVE_AREA => 30,
AddressField::LOCALITY => 30,
AddressField::DEPENDENT_LOCALITY => 30,
AddressField::POSTAL_CODE => 10,
AddressField::SORTING_CODE => 10,
AddressField::GIVEN_NAME => 25,
AddressField::ADDITIONAL_NAME => 25,
AddressField::FAMILY_NAME => 25,
];
/**
* Constructs a AddressDefaultWidget object.
*
......@@ -230,7 +214,8 @@ class AddressDefaultWidget extends WidgetBase implements ContainerFactoryPluginI
* {@inheritdoc}
*/
public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
return NestedArray::getValue($element['address'], $violation->arrayPropertyPath);
$error_element = NestedArray::getValue($element['address'], $violation->arrayPropertyPath);
return is_array($error_element) ? $error_element : FALSE;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment