Skip to content
Snippets Groups Projects
Commit 66d138cf authored by renatog's avatar renatog Committed by renatog
Browse files

Issue #3273126 by RenatoG: Make Maxlength for attributes work with multiple attributes

parent 7548040b
Branches
Tags 2.0.0-beta10
10 merge requests!62Issue #3272848 by RenatoG: When the error appear the field is hidden and the...,!59Issue #3497768: Click JavaScript to close details causes modals to scroll unnecessarily,!35Issue #3366420: \Drupal calls should be avoided in classes,!34Issue #3366420: \Drupal calls should be avoided in classes,!29Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!28Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!23Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!22Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!20Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!7Issue #3320529 by justcaldwell: block_classes_stored setting only retains classes from most recently saved block
......@@ -564,11 +564,20 @@ class BlockClassHelperService {
'#description' => $help_text,
];
// Default value for maxlength.
$maxlength_multiple_attributes = 255;
// Get maxlength if exists.
if (!empty($config->get('maxlength_attributes'))) {
$maxlength_multiple_attributes = $config->get('maxlength_attributes');
}
$form['multiple_attributes']['third_party_settings']['block_class']['attribute_' . $index]['attribute_key_' . $index] = [
'#type' => 'textfield',
'#title' => $this->t('Attribute Key'),
'#default_value' => $attribute_key,
'#description' => $this->t('Set the attribute key. E.g. data-block-type'),
'#maxlength' => $maxlength_multiple_attributes,
];
$form['multiple_attributes']['third_party_settings']['block_class']['attribute_' . $index]['attribute_value_' . $index] = [
......@@ -576,6 +585,7 @@ class BlockClassHelperService {
'#title' => $this->t('Attribute Value'),
'#default_value' => $attribute_value,
'#description' => $this->t('Set the attribute value. E.g. admin'),
'#maxlength' => $maxlength_multiple_attributes,
];
$form['multiple_attributes']['third_party_settings']['block_class']['attribute_' . $index]['#attributes']['class'][] = 'multiple-textfield-attribute';
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment