Install
Works with Drupal: ^9.2 || ^10 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
A bug-fix release for the 2.x branch. Quoted fallback strings can now contain pipes, Microsoft Office conditional comments are no longer stripped, and token validation now checks every OR token in a string. This is expected to be the last 2.x feature release; Drupal 12 support will come in 3.x, which drops Drupal 9.
Behavior changes
- Bracketed text containing a
|is only treated as an OR token when at least one part is a real token (type:name) or a quoted string. Other text such as[if mso | IE]is now left untouched, even with theclearoption (which the Webform submodule always sets). - Token validation (e.g. Pathauto patterns, Metatag fields) now checks every OR token in a value, not just the first. A value with an invalid token in a later OR group will show a validation error the next time it is saved.
Tested with
Drupal 9.5, 10.6 and 11.4 on PHP 8.1 through 8.5. Drupal 9 could only be installed for testing with Composer's security advisory blocking disabled; Drupal 9 support ends with 3.x.
Contributors (10)
ok4p1, pianomansam, keshav patel, jeroent, it-cru, milanbombschliip, mukeshaddweb, allandk, fromme, bryanmanalo
Changelog
Issues: 6 issues resolved.
Changes since 2.3.2:
Bug
- #3491615 Support for pipes inside of strings
- #3591289 Ignore mso comments
- #3337496 Deprecated function: preg_match_all(): Passing null to parameter #2
- Token validation only checked the first OR token in a string
Feature
- #3301741 Add token_or.api.php documenting hook_tokens_pre_alter()
- #3412515 Add Token OR example to Drupal internal help page
Development
- #3591318 Add ddev (ddev-drupal-contrib) for local development and testing
- CI now opts in to testing the previous core major, adjacent minors and the latest PHP