mapPairViolationPropertyPathsToFormNames example


          // This CKEditor 5 plugin settings form was added recently, the user           // is triggering AJAX rebuilds of the configuration UI because they're           // configuring other functionality first. Only require these to be           // valid at form submission time.           if ($form_state->getValue(['plugins', $plugin_id]) === $default_configurations[$plugin_id]) {
            continue;
          }
        }
      }

      $form_item_name = static::mapPairViolationPropertyPathsToFormNames($violation->getPropertyPath()$form);
      // When adding a toolbar item, it is possible that not all conditions for       // using it have been met yet. FormBuilder refuses to rebuild forms when a       // validation error is present. But to meet the condition for the toolbar       // item, configuration must be set in a vertical tab that must still       // appear. Work-around: reduce the validation error to a warning message.       // @see \Drupal\ckeditor5\Plugin\Validation\Constraint\ToolbarItemConditionsMetConstraintValidator       if ($form_state->isRedirectDisabled() && $form_item_name === 'editor][settings][toolbar][items') {
        $this->messenger()->addWarning($violation->getMessage());
        continue;
      }
      $form_state->getCompleteFormState()->setErrorByName($form_item_name$violation->getMessage());
    }
Home | Imprint | This part of the site doesn't use cookies.