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

  1. Add a class to represent the new Attribute - Example
  2. Update the plugin manager constructor to include both the attribute and annotation class names - example
  3. 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

Command icon 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:

Comments

larowlan created an issue. See original summary.

larowlan’s picture

Title: [PP-1] Convert ViewsQuery plugin discovery to attributes » Convert ViewsQuery plugin discovery to attributes
Issue summary: View changes
Status: Postponed » Active
Related issues: -#3421006: Convert ViewsDisplayExtender plugin discovery to attributes
larowlan’s picture

Issue summary: View changes

quietone made their first commit to this issue’s fork.

sorlov made their first commit to this issue’s fork.

sorlov’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Seems to have test failures.

sorlov’s picture

Status: Needs work » Needs review

fixed

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

All instances appear to be replaced.

alexpott’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

I'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!

  • alexpott committed fb396fbd on 11.x
    Issue #3421007 by sorlov, quietone, larowlan, smustgrave: Convert...

  • alexpott committed a3a4d885 on 10.3.x
    Issue #3421007 by sorlov, quietone, larowlan, smustgrave: Convert...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.