Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
plugin system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Jun 2013 at 07:34 UTC
Updated:
29 Jul 2014 at 22:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
amateescu commentedYes! I think this is immensly useful :)
Comment #3
damiankloip commentedActually fixing the tests for annotation discovery will also cover what this patch adds.
Comment #4
eclipsegc commentedBeen saying we should do this for a while now. Big ++ from me. The only problem is that this should be done to Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery, not the Component class.
Eclipse
Comment #5
damiankloip commentedOk, that makes sense. We will pretty much have to copy the method over verbatim as I have it in my patch.
Comment #6
damiankloip commentedHow about this instead? After speaking to Eclipse on IRC, we should preserve the class inheritance a bit better.
interdiff is based on patch from #3
Comment #7
eclipsegc commentedif 6 passes, I'm totally RTBC
Eclipse
Comment #8
damiankloip commentedThere was one stray empty line, thanks amateescu!
Comment #9
damiankloip commentedOk, also speaking to alexpott on IRC, we should only add the module key if it hasn't already been set.
Comment #10
amateescu commentedYep, I think it's only fair to not override this property if the plugin annotation already provides it.
Comment #11
tim.plunkett+1, nice regex
Comment #12
alexpottCommitted 0360c07 and pushed to 8.x. Thanks!
Comment #13
tstoecklerHmm.. this doesn't make very much sense for plugins provided by Drupal/Core. Couldn't we have gone with something generic like 'owner' or 'provider'?
Comment #14
damiankloip commentedI think only modules can provide plugins currently (correct me if I'm wrong)? Until that changes I think this is good. If it does, maybe this should be reviewed..
Comment #15
tstoecklerWell if Drupal/Core can't provide plugins then that's certainly a regression: #1828616: AnnotatedClassDiscovery is not finding plugins in Drupal\(Core|Component)\COMPONENT_NAME\Plugin directory :-)
#1821846: Consider better naming conventions for plugin types owned by includes doesn't seem like it's going anywhere lately, but I still think this particular bit is unnecessary.
$plugin['module'] == 'Core' // WTF??
$plugin['owner'] == 'Core'
$plugin['owner'] == 'node' // makes sense, IMO
Comment #16
damiankloip commentedYes, sorry. There is one implementation of this in Core nowdays - Validation constraints!
So, we should just change to this?
Comment #17
tstoecklerYay, thanks for the quick turnaround. I hadn't found the validation constraint plugins myself, but thanks for digging that up.
Assuming this is green, it's RTBC.
Comment #18
eclipsegc commentedSeems somewhat pedantic to me, but I'm also not really opposed so++
We should probably file followups to remove the module annotation from as many plugins as possible now in favor of owner.
Eclipse
Comment #19
msonnabaum commentedIs "owner" the right word here? Usually we use that to refer to users. What about "provider" instead?
Comment #20
effulgentsia commentedSpecifically, that's the only way the term is used in HEAD. Well, except for in the theme system, where it's used to refer to a file, but that's a separate thing we might want to fix in a different issue.
"owner" does have history as referring to a module name in CTools and I think some D8 CMI issues, but not in any HEAD code. Given that, I agree with #19's suggestion of 'provider'. Or if someone has other naming ideas, lets consider them.
Comment #21
damiankloip commentedHere is a patch to change it to 'provider' too.
I really don't care either way, and agree with eclipses comment in #18. Someone choose one, and let's just go with it. The expression 'Bigger fish to fry' springs to mind :)
Comment #23
dawehnerI guess this string should also refer to provider.
Comment #24
damiankloip commentedGood spot. Minimal comment change, leaving as rtbc.
Comment #25
alexpottCommitted e865959 and pushed to 8.x. Thanks!
Comment #26.0
(not verified) commentedDoesn't need tests.