Skip to content
Snippets Groups Projects

Drupal 11 compatibility

5 files
+ 58
15
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -81,17 +81,19 @@ class TextFieldFormatter extends StringFormatter {
* @param \Drupal\Core\Utility\Token $token
* The token service.
*/
public function __construct($plugin_id,
$plugin_definition,
FieldDefinitionInterface $field_definition,
array $settings,
$label,
$view_mode,
array $third_party_settings,
EntityTypeManagerInterface $entity_type_manager,
ModuleHandlerInterface $module_handler,
MessengerInterface $messenger,
Token $token) {
public function __construct(
$plugin_id,
$plugin_definition,
FieldDefinitionInterface $field_definition,
array $settings,
$label,
$view_mode,
array $third_party_settings,
EntityTypeManagerInterface $entity_type_manager,
ModuleHandlerInterface $module_handler,
MessengerInterface $messenger,
Token $token,
) {
parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings, $entity_type_manager);
$this->moduleHandler = $module_handler;
@@ -372,7 +374,7 @@ class TextFieldFormatter extends StringFormatter {
$attributes = explode("\r\n", $attributes);
foreach ($attributes as $attribute) {
$attribute = explode("|", $attribute);
$prepared[$attribute[0]] = isset($attribute[1]) ? $attribute[1] : '';
$prepared[$attribute[0]] = $attribute[1] ?? '';
}
}
Loading