Hello,
Is there any chance you can increase the maxlength on the two popup text fields(Line 1 (cookies), Line 2 (analytics))?
I need to populate these with longer text. I made a quick temporary change (see below) to be able to set the text I needed. After saving the page (and exporting config) I was able to wipe out my changes and carry on, but the next person to edit the settings might be confused if they are limited to 128 characters.
--- a/docroot/modules/contrib/gdpr_compliance/src/Form/SettingsPopup.php
+++ b/docroot/modules/contrib/gdpr_compliance/src/Form/SettingsPopup.php
@@ -79,12 +79,14 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#type' => 'textfield',
'#default_value' => $config->get('popup-text-cookies'),
'#description' => $this->t('Leave blank to use default: <i>@default</i>', ['@default' => $defaults['text-cookies']]),
+ '#maxlength' => 255,
];
$form["text"]['popup-text-analytics'] = [
'#title' => $this->t('Line 2 (analytics)'),
'#type' => 'textfield',
'#default_value' => $config->get('popup-text-analytics'),
'#description' => $this->t('Leave blank to use default: <i>@default</i>', ['@default' => $defaults['text-analytics']]),
+ '#maxlength' => 255,
];
$form["text"]['popup-btn-agree'] = [
'#title' => $this->t('Agree button'),
I can provide a patch if requested.
Thanks,
Adam
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | gdpr_compliance-popup-text-maxlength-3042374-5.patch | 929 bytes | agileadam |
Comments
Comment #2
apolitsin commentedThanks, Adam
good suggestion, try to solve soon
I will be grateful for the patch
Comment #3
agileadamExcellent. What would be an appropriate maxlength for the textfield?
I see this data is serialized and stored in a config table; there isn't a technical maximum (within reason).
Alternatively we could consider making these text areas. I don't want to overthink it though.
Comment #4
apolitsin commentedI think 255 is enough
Comment #5
agileadamPatch for 255 attached. Thank you!
Comment #7
apolitsin commentedthanks,
done in 8.x-1.14