function CKEditor5::mapPairViolationPropertyPathsToFormNames

Same name and namespace in other branches
  1. 10 core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php \Drupal\ckeditor5\Plugin\Editor\CKEditor5::mapPairViolationPropertyPathsToFormNames()
  2. 11.x core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php \Drupal\ckeditor5\Plugin\Editor\CKEditor5::mapPairViolationPropertyPathsToFormNames()

Maps Text Editor + Text Format pair property paths to form names.

Parameters

string $property_path: A config object property path.

array $form: The form being checked.

Return value

string The corresponding form name in the complete form.

1 call to CKEditor5::mapPairViolationPropertyPathsToFormNames()
CKEditor5::validateConfigurationForm in core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php
Form validation handler.

File

core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php, line 904

Class

CKEditor5
Defines a CKEditor 5-based text editor for Drupal.

Namespace

Drupal\ckeditor5\Plugin\Editor

Code

protected static function mapPairViolationPropertyPathsToFormNames(string $property_path, array $form) : string {
    // Fundamental compatibility errors are at the root. Map these to the text
    // editor plugin dropdown.
    if ($property_path === '') {
        return 'editor][editor';
    }
    // Filters are top-level.
    if (preg_match('/^filters\\..*/', $property_path)) {
        return implode('][', array_merge(explode('.', $property_path), [
            'settings',
        ]));
    }
    // Everything else is in the subform.
    return 'editor][' . static::mapViolationPropertyPathsToFormNames($property_path, $form);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.