Problem/Motivation
In #3252386: Use PHP attributes instead of doctrine annotations we added support for attribute based plugin discovery.
As part of that issue we converted block and action plugins.
This issue is to convert \Drupal\views\Annotation\ViewsQueryplugins to use Attributes.
There is no need to wait for the base class \Drupal\views\Annotation\ViewsPluginAnnotationBase as this plugin does not use that feature. It should instead extend from the base Plugin attribute in core.
Proposed resolution
- Add a class to represent the new Attribute - Example
- Update the plugin manager constructor to include both the attribute and annotation class names - example
- Convert all plugins that use the annotation to use the new attribute - example
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3421007
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3421007-convert-viewsquery-plugin
changes, plain diff MR !6862
Comments
Comment #2
larowlanComment #3
larowlanComment #4
larowlanComment #8
sorlov commentedComment #9
smustgrave commentedSeems to have test failures.
Comment #10
sorlov commentedfixed
Comment #11
smustgrave commentedAll instances appear to be replaced.
Comment #12
alexpottI've checked views to see how it uses query plugins and it does not ever call \Drupal\views\Views::fetchPluginNames(). I think that this means we should consider removing the no_ui property - but this is for a follow-up as it is in the annotation too - so should be converted. Also the generic base and display types keys are meaningless and not in the attribute so it's fine to not have them.
Committed and pushed fb396fbd26 to 11.x and a3a4d88526 to 10.3.x. Thanks!