Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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\layout_builder\Annotation\SectionStorage
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
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3421019
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 #2
DanielVezaComment #4
DanielVezaI've set up the SectionStorage Attribute and converted all existing plugins over to the Attribute. Tests green, Ready for review
Comment #5
smustgrave CreditAttribution: smustgrave commentedFor the open threads. Leaving currently assigned assuming @DanielVeza you wanted to work on this one.
Comment #6
DanielVezaPushed up a commit that fixes most of the MR feedback. This is the leftover item, need to look into it more.
PHPStorm doesn't like it. I wonder if static functions aren't allowed here
Comment #7
DanielVezaSetting back to needs review. Resolved all threads except one, and left a comment about why that one may not work. Unless I'm misunderstanding something
Comment #8
smustgrave CreditAttribution: smustgrave commentedFor the 1 thread.
Comment #9
DanielVezaAgreed with the the last feedback item. Pushed up a commit, back to NR
Comment #10
mstrelan CreditAttribution: mstrelan at PreviousNext commentedI think we need to document the params as per the annotation class.
Comment #11
DanielVezaComment #12
mstrelan CreditAttribution: mstrelan at PreviousNext commentedAs per @larowlan I think we need to add
public readonly ?string $deriver = NULL
to the constructor params.Comment #14
sorlov CreditAttribution: sorlov at Skilld commentedComment #15
smustgrave CreditAttribution: smustgrave commentedSeems to have a check failure
Comment #16
sorlov CreditAttribution: sorlov at Skilld commentedfixed phpstan issue
Comment #17
smustgrave CreditAttribution: smustgrave commentedFeedback appears to be addressed.
Comment #19
alexpottCommitted and pushed 4fcae3ca53 to 11.x and 31ec7d645e to 10.3.x. Thanks!
Comment #22
kim.pepperCan someone close the MR?