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
SchemaInterface::suggestConfig() is non-static because it uses (indirectly) PluginInspectionInterface::getPluginDefinition(). Thus SchemaManager::suggestConfig() has to instantiate the matching plugin schema, only to call the method.
Proposed resolution
Make SchemaInterface::suggestConfig() static, and pass the plugin definition array as a parameter so the label and description are available.
Comment | File | Size | Author |
---|---|---|---|
#9 | avoid_creating-2473767-9-interdiff.txt | 1.28 KB | mbovan |
#9 | avoid_creating-2473767-9.patch | 5.6 KB | mbovan |
#7 | avoid_creating-2473767-7.patch | 5.58 KB | mbovan |
#4 | static-suggestconfig-2473767-4.interdiff.txt | 1.55 KB | Arla |
#4 | static-suggestconfig-2473767-4.patch | 4.87 KB | Arla |
Comments
Comment #1
miro_dietikerYeah you identified the origin - at least one - of what i thought with:
#2466599: Improve Suggestion code
Comment #2
ArlaOh. IMHO the issue summary over there is a bit unclear ;)
Comment #3
ArlaComment #4
ArlaSome more cleanup. Not fully relevant.
Comment #7
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedRerolled and made some small fixes here.
Comment #8
ArlaInterestingly, we still didn't switch to calling the method statically :) I think we can do $definition['class']::suggestConfig().
Let's correct the spelling of "entities" while we're at it.
Comment #9
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedFixed.
Comment #11
ArlaThanks.
Committed and pushed!
Let's look into improving the code further in #2466599: Improve Suggestion code as requested by @miro_dietiker in #1.