Mapbox token exceeds character limit

Created on 5 August 2022, about 2 years ago
Updated 6 August 2024, about 2 months ago

Problem/Motivation

I created a fresh access token at mapbox.com. It turns out at a length of characters. The problem is the form on the module configuration page allows only a maximum of characters (with a field size of 86).

Steps to reproduce

1. Create a new token at mapbox.com
2. Install module and try to enter it in the `Access Token` field

Proposed resolution

Extend the field length to allow the full token size.

🐛 Bug report
Status

Fixed

Version

8.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom Mattgh9152

    This is now an issue again, as the Mapbox Access Key has increased in size further.

    Can I recommend setting the max length to, say, 255, if it's required at all?

    diff --git a/src/Form/ConfigForm.php b/src/Form/ConfigForm.php
    index 2b6ec86..a3418ac 100644
    --- a/src/Form/ConfigForm.php
    +++ b/src/Form/ConfigForm.php
    @@ -65,8 +65,8 @@ class ConfigForm extends ConfigFormBase {
         $form['access_token'] = [
           '#type' => 'textfield',
           '#title' => $this->stringTranslation->translate('Access Token'),
    -      '#maxlength' => 98,
    -      '#size' => 98,
    +      '#maxlength' => 255,
    +      '#size' => 255,
           '#required' => TRUE,
           '#default_value' => $config->get('access_token'),
         ];
    
Production build 0.71.5 2024