Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
block.module
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Dec 2012 at 22:02 UTC
Updated:
29 Jul 2014 at 21:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #0.0
xjmUpdated issue summary.
Comment #0.1
xjmUpdated issue summary.
Comment #0.2
xjmUpdated issue summary.
Comment #1
xjmThere are at least two methods, I guess; one for the base plugin ID and one for the derivative ID.
In the course of trying to figure out where generic methods for the plugin system would go, I discovered that
DerivativeDiscoveryDecoratoralready has decodePluginId() and encodePluginId(). We're just not using them.Comment #2
xjmAlso, it looks to me like
decodePluginId()erroneously assumes that there's only ever one derivative. I think it should be taking the last segment after a colon rather than the first? Or perhaps there should be separate methods for the base plugin ID, the parent derivative, and the current derivative?Comment #2.0
xjmUpdated issue summary.
Comment #2.1
xjmUpdated issue summary.
Comment #2.2
xjmUpdated issue summary.
Comment #3
xjmComment #4
xjmComment #5
jibranI tried to understand the problem. I think we can create wrapper functions of
getPluginId()likegetBasePluginId()getDerivativeId()Comment #6
jibranHere is the start.
Comment #8
jibran#6: 1874498-6.patch queued for re-testing.
Comment #10
tim.plunkettMany things implement PluginInspectionInterface without extending PluginBase
And many of them don't use derivatives.
Comment #11
jibranOk got it. Removed the changes in
PluginInspectionInterface.Comment #12
tim.plunkettIt still needs an interface somewhere. Maybe a new one that all classes with 'derivative' in the annotation *should* implement? Not sure. Traits would probably have been useful here...
Comment #13
benjy commentedAs per @tim.plunkett's comment, setting this back to "needs work"
Comment #14
neclimdulseems related to this ancient issue #1678612: Make getBasePluginId and getDerivativeId static and public. There doesn't really seem to be a stated problem here though. The "problem" in the summary is a stating of facts and I'm not going to try and figure out what from that 400 comment thread we're talking about. Could we be more clear about the problematic use case?
Comment #15
tim.plunkettHopefully this patch will illustrate the problem this solves. The issue summary should still be updated.
Comment #16
tim.plunkettAnd yes, I know that I am contradicting myself in #10, but I think that it's better to add these methods here than to force another interface on, at least without traits.
Comment #18
tim.plunkettOkay, nevermind. Here's the middle ground: 2 interfaces, but the base class just implements both. You're not forced into it.
Comment #20
tim.plunkettI hate BlockTemplateSuggestionsUnitTest.
Comment #21
dawehnerBecause this needed a rerole.
Comment #23
neclimdul#21: plugin-1874498-21.patch queued for re-testing.
Comment #24
tim.plunkettRerolled. Let's stop propagating this ugliness.
Comment #26
xanoDoes this overlap with #2035345: Reconsider whether to use ':' as separator for derivative plugins?
Comment #27
dawehnerI would say so as the other issue moves the responsibility to define the separator into another object.
Comment #28
tim.plunkettThere was a new test added recently.
Comment #29
tim.plunkettReroll.
Comment #30
dawehnerSort of out of scope but I don't care.
HAHAH
Comment #31
catch#29: plugin-1874498-29.patch queued for re-testing.
Comment #33
dawehnerRerolled
Comment #34
ParisLiakos commentedthose should use data providers to avoid code duplication
also, no longer applies
Comment #35
dawehnerGood point.
Comment #35.0
dawehnerUpdated issue summary.
Comment #36
benjy commentedA few commas missing. I'll do a proper review in the day few days.
Missing comma.
here
here
here
Comment #37
dawehnerGood catches!
Comment #38
aspilicious commentedComment #39
aspilicious commentedLooks good to me.
Comment #40
xanoI wonder if it might not be a good idea to use a constant for the separator, since this is also used by
DerivativeDiscoveryDecoratorand the whole derivative system currently relies on the separator being a colon. See #2035345: Reconsider whether to use ':' as separator for derivative plugins as well.The class name does not match the file name.
Comment #41
dawehnerThank you for the review.
Comment #42
andypost41: plugin-1874498.patch queued for re-testing.
Comment #44
dawehner41: plugin-1874498.patch queued for re-testing.
Comment #45
benjy commentedStatus was wrong.
Comment #46
benjy commentedRe-rolled. +1 for RTBC from me.
Comment #47
andypostIt works!
Comment #48
catchCommitted/pushed to 8.x, thanks!