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.
Updated: Comment #0
Problem/Motivation
Sometimes there's not enough to search in the top discovery directory for annotated plugins.
Here's a case:
core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/GDResize.php
core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/GDRotate.php
etc.
should live on
core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/gd/Resize.php
core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/gd/Rotate.php
etc. but also...
core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/imagemagick/Resize.php
But this is not possible now because we search only in $subdir
of AnnotatedClassDiscovery
.
Proposed resolution
Allow recursion limited by a max depth argument.
Remaining tasks
N/A
User interface changes
None.
API changes
- New
$max_depth
int optional argument inAnnotatedClassDiscovery
(both Component and Core) - New
$max_depth
int optional argument inDefaultPluginManager
.
Related Issues
N/A
Comment | File | Size | Author |
---|---|---|---|
#1 | plugin-discovery-recursion-2121541-1.patch | 8.51 KB | claudiu.cristea |
Comments
Comment #1
claudiu.cristeaPatch.
Comment #1.0
claudiu.cristeaUpdated issue summary.
Comment #3
swentel CreditAttribution: swentel commentedsee #2103155: Pick up plugins in subdirs
Comment #3.0
swentel CreditAttribution: swentel commentedUpdated issue summary.