Problem/Motivation
- A views handler (e.g.) a filter can be configured to use a particular plugin
- The Views Handler Manager does not respect this and takes whatever plugin is defined by views data (hook_views_data + hook_views_data_alter)
- See ViewsHandlerManager::getHandler($item) - the $item contains the correct plugin_id, yet that is ignored and the views data plugin ID is used instead
This is a problem for #3347343: Continuation Add Views EntityReference filter to be available for all entity reference fields in particular as it means existing configuration is not respected, forcing us to duplicate the views filter rather than allow replacement to avoid a breaking change.
Steps to reproduce
- Create a filter, e.g. a numeric filter on a View
- Use hook_views_data_alter to change the default filter to something else (e.g. entity_reference)
- Check the configured view; the numeric configuration is not respected and the filter plugin loaded is entity_reference instead of the configured numeric filter
Proposed resolution
Ensure that ViewsHandlerManager respects existing configuration
Remaining tasks
Update ViewsHandlerManager to respect existing configuration
Add automated test case to verify this
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
Views configuration is no longer overridden by views data (hook_views_data + hook_views_data_alter)