Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

URL-friendly options

Security covered Under active development 2,021 sites

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.

Drupal 10–11

Ask your assistant about URL-friendly options

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • options Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
5
Tracked since
Jul 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 3
Maintenance
Slowing

Release Timeline

Releases

Version Type Core PHP Release date
2.0.1 Stable 10–11 Jun 5, 2025
2.0.0 Stable 10–11 May 28, 2025
2.0.x-dev Dev 10–11 May 24, 2025
1.0.0 Stable 9–10 Jul 5, 2024
1.0.0-beta2 Pre-release 9–10 Jul 4, 2023