Region class field: increase maxlength from 40 to 255

Created on 24 September 2025, 13 days ago

Problem/Motivation

The “Region classes” textfields in Barrio theme settings are capped at `#maxlength => 40`, which prevents adding a reasonable number of utility classes (e.g., Bootstrap layout + responsive utilities). This limit appears arbitrary and inconsistent with other settings in the same form (e.g., breadcrumb divider allows 256).

Relevant occurrences in theme-settings.php:

  • Region classes (per region): #size => 40, #maxlength => 40
  • Navbar custom classes:
    • bootstrap_barrio_navbar_top_class: #maxlength => 40
    • bootstrap_barrio_navbar_class: #maxlength => 40
  • Scrollspy element ID: #maxlength => 40
  • Breadcrumb divider (for comparison): #maxlength => 256

Steps to reproduce

  1. Go to Appearance → Settings for a Barrio (or subtheme).
  2. Open Layout → Region and choose any region.
  3. In “Classes for <region>”, try adding several Bootstrap utilities (e.g., d-flex justify-content-between align-items-center py-3 gap-2 flex-wrap).
  4. Attempt to save; the string is truncated/blocked at 40 characters.

Proposed resolution

  • Increase #maxlength for the following textfields from 40 to something practical (e.g., 255) to align with typical Drupal textfield limits and with the breadcrumb divider field:
    • bootstrap_barrio_region_class_* (all regions)
    • bootstrap_barrio_navbar_top_class
    • bootstrap_barrio_navbar_class
    • bootstrap_barrio_scroll_spy (ID fields often exceed 40 in complex layouts)
  • Optionally increase #size for better UX (e.g., 80) without affecting storage.
  • Document the change in the theme settings help text (no behavioral change, just more room).

Remaining tasks

  • [ ] Update #maxlength (and optionally #size) for the fields listed above.
  • [ ] Manually test long class strings in Region + Navbar settings.
  • [ ] Confirm no configuration schema impact (theme settings are strings already).
  • [ ] Add a brief change note in README or release notes.

User interface changes

  • Textfields accept longer values and may render wider if #size is increased.

API changes

  • None.

Data model changes

  • None (existing config keys continue to store strings; only max input length increases).
Feature request
Status

Active

Version

5.5

Component

User interface

Created by

🇺🇸United States trackleft2 Tucson, AZ 🇺🇸

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

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024