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).
CommentFileSizeAuthor
#4 3548552-4.patch523 bytestrackleft2
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

trackleft2 created an issue. See original summary.

trackleft2’s picture

Issue summary: View changes

trackleft2’s picture

StatusFileSize
new523 bytes

Adding a static patch.

joegraduate’s picture

Status: Active » Needs review
j_s’s picture

Tested MR!111 and was able to successfully enter more than 40 characters.

trackleft2’s picture

So far I've only added 1 of the proposed changes because I am looking for guidance from the maintainer on what direction they suggest.

hatuhay made their first commit to this issue’s fork.

  • hatuhay committed 4e040e38 on 5.5.x authored by trackleft2
    Issue #3548552 Region class field: increase maxlength from 40 to 255.
    
hatuhay’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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