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

Merge branch '3494949-2.0.0-rc1-allow-identifier' into '2.0.x'

Resolve #3494949 "2.0.0 rc1 allow identifier"

See merge request !307
parents d87fec0b 2f417c14
No related branches found
No related tags found
No related merge requests found
Pipeline #373668 passed
......@@ -19,6 +19,7 @@ use Drupal\ui_patterns\PropTypePluginBase;
label: new TranslatableMarkup('Identifier'),
description: new TranslatableMarkup('A string with restricted characters, suitable for an HTML ID.'),
default_source: 'textfield',
convert_from: ['string'],
schema: ['type' => 'string', 'pattern' => '(?:--|-?[A-Za-z_\x{00A0}-\x{10FFFF}])[A-Za-z0-9-_\x{00A0}-\x{10FFFF}\.]*'],
priority: 100
)]
......@@ -33,4 +34,13 @@ class IdentifierPropType extends PropTypePluginBase {
return strip_tags(static::convertToString($value));
}
/**
* {@inheritdoc}
*/
public static function convertFrom(string $prop_type, mixed $value): mixed {
return match ($prop_type) {
'string' => (string) $value,
};
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment