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

Comments

agileadam created an issue. See original summary.

apolitsin’s picture

Assigned: Unassigned » apolitsin

Thanks, Adam

good suggestion, try to solve soon
I will be grateful for the patch

agileadam’s picture

Excellent. 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.

apolitsin’s picture

I think 255 is enough

agileadam’s picture

Patch for 255 attached. Thank you!

  • APolitsin committed 0b9b556 on 8.x-1.x authored by agileadam
    Issue #3042374 by agileadam: Maxlength on popup line 1 and line 2 fields
    
apolitsin’s picture

Status: Active » Fixed

thanks,
done in 8.x-1.14

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.