Skip to content
Snippets Groups Projects
Commit ccbe4bcd authored by Mikael Meulle's avatar Mikael Meulle
Browse files

Issue #3465517 by just_like_good_vibes: ui_patterns_element_info_alter()...

Issue #3465517 by just_like_good_vibes: ui_patterns_element_info_alter() implementation overrides allowed formats for all text_format elements
parent aef08e90
Branches
Tags
1 merge request!167FIX bug
Pipeline #242824 passed with warnings
......@@ -87,6 +87,9 @@ class WysiwygWidget extends SourcePluginBase implements TrustedCallbackInterface
$value = $this->getSetting('value');
$element = [
'#type' => 'text_format',
'#pre_render' => [
[static::class, 'textFormat'],
],
];
if (is_array($value) && array_key_exists("value", $value)) {
$element['#default_value'] = $value['value'];
......
......@@ -7,8 +7,6 @@
declare(strict_types=1);
use Drupal\ui_patterns\Plugin\UiPatterns\Source\WysiwygWidget;
/**
* Implements hook_element_info_alter().
*/
......@@ -17,7 +15,6 @@ function ui_patterns_element_info_alter(array &$types): void {
array_unshift($types['component']['#pre_render'], 'ui_patterns.component_element_alter:alter');
array_unshift($types['component']['#pre_render'], 'ui_patterns.component_element_builder:build');
}
$types['text_format']['#pre_render'][] = [WysiwygWidget::class, 'textFormat'];
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment