- π¦πΊAustralia mstrelan
I assume this is referring to views exposed filters. It's worth noting that
hook_options_list_alter
is called from\Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsWidgetBase::getOptions
so perhaps it's only intended to work on field widgets. The options available in views exposed filters are populated in\Drupal\views\Plugin\views\filter\InOperator::getValueOptions
. Either way, I think anallowed_values_function
callback might be a better way to achieve this. - π΅π±Poland adpo
Thank you @mstrelan I was able to determine the route name inside hook_options_list_alter
$current_route_name = \Drupal::service('current_route_match')->getRouteName();
- Status changed to Postponed: needs info
about 2 years ago 10:38pm 23 March 2023 - π¦πΊAustralia mstrelan
@adpo so is this resolved? I'm not quite sure I understand the issue. If it's not resolved please provide the steps to reproduce the issue.
- π΅π±Poland adpo
Actually it didnβt (old project). I will try again with different approach. Yes, was reffering to exposed filters.
- Status changed to Closed: works as designed
11 months ago 6:31am 4 May 2024 - π¦πΊAustralia pameeela
Marking this works as designed based on the previous comments.