Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently, when calling optionsList('view')
on a metadata wrapper for a taxonomy reference field, the returned list is identical to the one returned for optionsList('edit')
– i.e., prefixed with dashes according to their hierarchical levels.
Option values should instead be the entity labels, i.e., the term names without dashes.
(And yes, I know that using label()
will make much more sense most of the time anyways, but the results of both variants should be consistent since there are still times when using the option list makes sense.)
Comments
Comment #1
quotesBro CreditAttribution: quotesBro commented