Quantcast
Viewing all articles
Browse latest Browse all 294943

Views handler loading should respect configuration

Problem/Motivation

  1. A views handler (e.g.) a filter can be configured to use a particular plugin
  2. The Views Handler Manager does not respect this and takes whatever plugin is defined by views data (hook_views_data + hook_views_data_alter)
  3. 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

  1. Create a filter, e.g. a numeric filter on a View
  2. Use hook_views_data_alter to change the default filter to something else (e.g. entity_reference)
  3. 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)


Viewing all articles
Browse latest Browse all 294943

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>