Skip to content
Snippets Groups Projects
Commit 98af9c51 authored by Sascha Grossenbacher's avatar Sascha Grossenbacher
Browse files

Issue #3333974 by Berdir, Charchil Khandelwal, herved: Stop using $error->arrayPropertyPath

parent 9ce71acd
No related branches found
No related tags found
1 merge request!131Issue #3333974: Stop using $error->arrayPropertyPath
Pipeline #246187 passed with warnings
......@@ -2558,7 +2558,9 @@ class ParagraphsWidget extends WidgetBase {
public function errorElement(array $element, ConstraintViolationInterface $error, array $form, FormStateInterface $form_state) {
// Validation errors might be a about a specific (behavior) form element
// attempt to find a matching element.
if (!empty($error->arrayPropertyPath) && $sub_element = NestedArray::getValue($element, $error->arrayPropertyPath)) {
$property_path_array = explode('.', $error->getPropertyPath());
array_shift($property_path_array);
if (!empty($property_path_array) && $sub_element = NestedArray::getValue($element, $property_path_array)) {
return $sub_element;
}
return $element;
......
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