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\ViewsExposedFormplugins to use Attributes.

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-3421008

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 ViewsExposedForm plugin discovery to attributes » Convert ViewsExposedForm and ViewsPluginAnnotationBase plugin discovery to attributes
Issue summary: View changes
Status: Postponed » Active
Related issues: -#3421006: Convert ViewsDisplayExtender plugin discovery to attributes

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

el7cosmos’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Left a small comment.

el7cosmos’s picture

Status: Needs work » Needs review

sorry, wrong issue, this was meant for https://www.drupal.org/project/drupal/issues/3421010

el7cosmos’s picture

Status: Needs review » Active

el7cosmos’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Seems all feedback has been addressed

Searching for @ViewsExposedForm and all 2 instances have been replaced.

quietone’s picture

Status: Reviewed & tested by the community » Needs work

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

sorlov’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Open threads on MR.

sorlov’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Feedback appears to be addressed.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Left some comments on the MR

sorlov’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Suggestions appear to be added.

alexpott’s picture

Title: Convert ViewsExposedForm and ViewsPluginAnnotationBase plugin discovery to attributes » Convert ViewsExposedForm plugin discovery to attributes
alexpott’s picture

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

Committed and pushed 4586e9fc62 to 11.x and 5d7c6f182a to 10.3.x. Thanks!

diff --git a/core/modules/views/src/Attribute/ViewsExposedForm.php b/core/modules/views/src/Attribute/ViewsExposedForm.php
index 1fca4a2f60..6f9be79da8 100644
--- a/core/modules/views/src/Attribute/ViewsExposedForm.php
+++ b/core/modules/views/src/Attribute/ViewsExposedForm.php
@@ -28,19 +28,21 @@ class ViewsExposedForm extends Plugin {
    * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $short_title
    *   (optional) The short title used in the views UI.
    * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $help
-   *   A short help string; this is displayed in the views UI.
+   *   (optional) A short help string; this is displayed in the views UI.
    * @param string[]|null $display_types
-   *   The types of the display this plugin can be used with.
+   *   (optional) The types of the display this plugin can be used with.
    *   For example the Feed display defines the type 'feed', so only rss style
    *   and row plugins can be used in the views UI.
    * @param string[] $base
-   *   The base tables on which this exposed form plugin can be used.
+   *   (optional) The base tables on which this exposed form plugin can be used.
    *   If no base table is specified the plugin can be used with all tables.
    * @param bool $no_ui
-   *   Whether the plugin should be not selectable in the UI.
+   *   (optional) Whether the plugin should be not selectable in the UI.
    *   If it's set to TRUE, you can still use it via the API in config files.
+   *   Defaults to FALSE.
    * @param bool $register_theme
-   *   (optional) Whether or not to register a theme function automatically. Defaults to TRUE.
+   *   (optional) Whether to register a theme function automatically. Defaults
+   *   to TRUE.
    * @param class-string|null $deriver
    *   (optional) The deriver class.
    */

Did some docs improvements on commit.

  • alexpott committed 5d7c6f18 on 10.3.x
    Issue #3421008 by el7cosmos, sorlov, smustgrave, larowlan, alexpott,...

  • alexpott committed 4586e9fc on 11.x
    Issue #3421008 by el7cosmos, sorlov, smustgrave, larowlan, alexpott,...
alexpott’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

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