diff --git a/core/lib/Drupal/Core/Field/WidgetBase.php b/core/lib/Drupal/Core/Field/WidgetBase.php
index 4e9fd0ae2d..f8e0751bb7 100644
--- a/core/lib/Drupal/Core/Field/WidgetBase.php
+++ b/core/lib/Drupal/Core/Field/WidgetBase.php
@@ -440,7 +440,7 @@ public function flagErrors(FieldItemListInterface $items, ConstraintViolationLis
         $violations_by_delta = $item_list_violations = [];
         foreach ($violations as $violation) {
           // Separate violations by delta.
-          $property_path = explode('.', $violation->getPropertyPath());
+          $property_path = $this->getPropertyPathArray($violation);
           $delta = array_shift($property_path);
           if (is_numeric($delta)) {
             $violations_by_delta[$delta][] = $violation;
@@ -449,7 +449,6 @@ public function flagErrors(FieldItemListInterface $items, ConstraintViolationLis
           else {
             $item_list_violations[] = $violation;
           }
-          $violation->arrayPropertyPath = $property_path;
         }
 
         /** @var \Symfony\Component\Validator\ConstraintViolationInterface[] $delta_violations */
@@ -609,4 +608,17 @@ protected function getFilteredDescription() {
     return FieldFilteredMarkup::create(\Drupal::token()->replace((string) $this->fieldDefinition->getDescription()));
   }
 
+  /**
+   * Returns property path as array.
+   *
+   * @param \Symfony\Component\Validator\ConstraintViolationInterface $violation
+   *   The violation to get its property path.
+   *
+   * @return array
+   *   Array of path slugs.
+   */
+  protected function getPropertyPathArray(ConstraintViolationInterface $violation): array {
+    return explode('.', $violation->getPropertyPath());
+  }
+
 }
diff --git a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php
index 11e84f1c3e..01ca61bd59 100644
--- a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php
+++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php
@@ -46,7 +46,9 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
    * {@inheritdoc}
    */
   public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
-    if ($violation->arrayPropertyPath == ['format'] && isset($element['format']['#access']) && !$element['format']['#access']) {
+    $property_path = $this->getPropertyPathArray($violation);
+    array_shift($property_path);
+    if ($property_path == ['format'] && isset($element['format']['#access']) && !$element['format']['#access']) {
       // Ignore validation errors for formats if formats may not be changed,
       // such as when existing formats become invalid.
       // See \Drupal\filter\Element\TextFormat::processFormat().
diff --git a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
index 1dcb00b96b..5bcc61fb32 100644
--- a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
+++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
@@ -100,7 +100,9 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
    */
   public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
     $element = parent::errorElement($element, $violation, $form, $form_state);
-    return ($element === FALSE) ? FALSE : $element[$violation->arrayPropertyPath[0]];
+    $property_path = $this->getPropertyPathArray($violation);
+    array_shift($property_path);
+    return ($element === FALSE) ? FALSE : $element[$property_path[0]];
   }
 
 }
diff --git a/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php
index e6954cc1df..2c5531604a 100644
--- a/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php
+++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php
@@ -37,7 +37,9 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
    * {@inheritdoc}
    */
   public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
-    if ($violation->arrayPropertyPath == ['format'] && isset($element['format']['#access']) && !$element['format']['#access']) {
+    $property_path = $this->getPropertyPathArray($violation);
+    array_shift($property_path);
+    if ($property_path == ['format'] && isset($element['format']['#access']) && !$element['format']['#access']) {
       // Ignore validation errors for formats that may not be changed,
       // such as when existing formats become invalid.
       // See \Drupal\filter\Element\TextFormat::processFormat().
