Problem/Motivation
The 'Search Results' row plugin is always available, regardless of the display type. This should work correctly with display type filtering.
E.g.
If you try to use this in a feed view, it will break too.
Steps to reproduce
- Go to Structure > Views > Taxonomy term > Edit > Feed
- Select the link "Show: Content"
- Expected: The "Search results" format should not be available.
- Actual: The option is available, and the resulting preview prints invalid markup containing
ArrayArray
The same issue can also be seen for pagers right now. Again, on the feed display, all pagers are available whereas only 'basic' ('Display all items' and 'Display a specified number of items') type pagers should be available as usesPager() for the display is false.
Proposed resolution
Add a 'display_types' default value of ['normal']
to the ViewsPluginManager defaults. This will improve DX (otherwise you will always have to specify at least display_types = {"normal"}
in your annotations).
We need to do this after the regular default values have been merged. Otherwise we will get arrays being concatenated during the deep merging. I.e. 'normal' will be added to every display_types array.
This can then be overridden like RestExport or Feeds do, or set to NULL if no type really is desired (this will be rare).
Remaining tasks
User interface changes
None
API changes
None
<!--<tr><th><a href="https://www.drupal.org/core/beta-changes#prioritized">Prioritized changes</a></th><td>The main goal of this issue is usability/accessibility/security/performance/removing code already deprecated for 8.0.0/Migrate. (Which? Specify.)</td></tr>--><!--<tr><th><a href="https://www.drupal.org/core/beta-changes#disruption">Disruption</a></th> <td>Disruptive for core/contributed and custom modules/themes because it will require a BC break/deprecation/data model changes/an upgrade path/internal refactoring/widespread changes... (Which? Specify.)</td></tr>-->