Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

URL-friendly options

2,052 sites Security covered
View on drupal.org

This module ensures that option list fields use URL-friendly keys, meaning only letters, numbers, and hyphens are allowed. This makes it easier to use these fields in views as contextual filters. The module does not modify existing values but prevents the addition of new options with invalid keys.

This module enforces that all option list fields have keys that are composed only of alpha-numeric characters and hyphens.

For example the list below is a valid list:

first-value|First value
second-value|Second value

While this list isn't allowed:

first_value|First value
second value!|Second value!

This means that if you end up needing to use this field as a contextual filter in a view, the keys are already URL-friendly.

Notes

1) This module will not change existing values. However, it won't be possible to add new values to the list if there are non-compliant pre-existing keys, since the form won't validate. A status report message will display an error if there are any keys that fail validation.

2) If there are exceptions that need to bypass this module's validation, developers can implement hook_url_friendly_options_bypass_field_validation() and mark a particular field to be skipped.

Activity

Total releases
3
First release
May 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 3
Maintenance
Dormant

Release Timeline

Releases

Version Type Release date
2.0.1 Stable Jun 5, 2025
2.0.0 Stable May 28, 2025
2.0.x-dev Dev May 24, 2025