Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
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\ViewsSort
plugins to use Attributes.
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
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3426961
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
Comment #4
mstrelan CreditAttribution: mstrelan at PreviousNext commentedThis should probably be postponed on #3426955: Convert ViewsField plugin discovery to attributes which adds
ViewsHandlerAttributeBase
.Comment #5
mstrelan CreditAttribution: mstrelan at PreviousNext commentedTurns out we don't need
ViewsHandlerAttributeBase
, but we will still need the changes toViewsHandlerManager
, so this is still postponed.Comment #7
sorlov CreditAttribution: sorlov at Skilld commentedComment #8
smustgrave CreditAttribution: smustgrave at Mobomo commentedAppears to have a test failure
Comment #9
sorlov CreditAttribution: sorlov at Skilld commentedComment #10
mstrelan CreditAttribution: mstrelan at PreviousNext commentedLeft a comment about the base class for the attribute class.
Also, let's update the description in
\Drupal\views\Plugin\views\sort\SortPluginBase
to mention attributes instead of annotations.Comment #11
sorlov CreditAttribution: sorlov at Skilld commentedComment #12
smustgrave CreditAttribution: smustgrave at Mobomo commentedFeedback appears to be addressed.
Comment #13
alexpottCommitted and pushed 77ccadfb80 to 11.x and e4791b4381 to 10.3.x. Thanks!