Currently, if your looking at the latest revision of a Panelized entity, then editing with the IPE will create a new revision. But if you're viewing an old revision, then editing with the IPE overwrite that revision.
However, if you're employing a workflow module (like Workbench Moderation) then it might not make sense to expose the IPE on the publish revision, or any previous ones, but only the latest draft revision.
This issue proposes to create a plugin type that would allow other modules (like Workbench Moderation, or some integration module) to provide a plugin that can disable the IPE based on custom logic.
Comment | File | Size | Author |
---|---|---|---|
#3 | 2667754-3.patch | 6.83 KB | EclipseGc |
|
Comments
Comment #2
dsnopekHere's a patch that would disable the IPE if on a revision that isn't the latest revision.
However, EclipseGC brought up that this would break a "CPS with the election night scenario" use case. So, this actually won't work long-term. :-(
So, the question is: Do want to include this in the near-term and replace it later? Or, do we want to come up with the full solution first?
Comment #3
EclipseGc CreditAttribution: EclipseGc commentedSo I spent some time on this today to see if I could abstract out a plugin type for this work. The patch is a little rough still, but should communicate the idea. I'll put the workbench_moderation plugin below as an example.
Eclipse
Comment #4
dsnopekSince @EclipseGC came up with a use case that shot holes through my original proposal to simply bake it into Panelizer to only show the IPE on the latest revision, I've re-purposed this issue for his proposal to add a plugin type to the Panels IPE (and moved this issue there).
Comment #5
dsnopekOne tiny bit of review!
We don't *really* need the human-readable label. Maybe this could just be
PluginId
and take only id? These'll never be choosable in the UI.Comment #6
EclipseGc CreditAttribution: EclipseGc commentedYeah, but I could imagine a UI that tells you which plugins will apply. That could be really nice for having insight into what's going on and who's making the decisions about when IPE displays.
Eclipse
Comment #7
japerry+1 to making it configurable for plugins. It can be a bit daunting if you don't know what plugins are working on what. At a minimum it'd be great to have a page that shows all the plugins that apply.
So this class is basically for IPE... but I feel like we should abstract this access plugin pipeline a bit more. Talked on IRC about any display renderer being able to use similar plugins, and I agree.
As far as the access plugins go, I'm not sure there is a need to take it further out than panels at the moment. Maybe this is one of those components that panels manages?
Comment #8
dsnopekSo, what would other display builders do if access is denied? With IPE, it basically falls back on the standard display builder when access is denied. But I'm not sure what we'd do if, for example, the standard display builder were selected and access were denied...
Comment #9
EclipseGc CreditAttribution: EclipseGc commentedwell, I think we need to introduce the idea of a frontend renderer. And allow the access check on those. It's a different classification of thing, and administratively, on the backend, I don't really care about wbm's opinion when we're on a panels (or whatever) admin page. But when we're collaborating on rendering something, if we are using a frontend renderer, we should ask other module's opinions.
Eclipse
Comment #10
Crell CreditAttribution: Crell at Palantir.net for Acquia commentedAt the risk of picking an old fight with EclipseGc :-), why a plugin? This seems like a simple voter pattern of tagged services. What's the value-add of plugins here over "a bunch o' objects that return yep/nope"? This doesn't feel like a user-configurable problem space to me...
Comment #11
EclipseGc CreditAttribution: EclipseGc commentedIt's not a user configurable problem space per say. I've been arguing with myself on this. Beyond the ability to store metadata that can be used in an information UI, I can see an argument for these being a tagged service. Frankly though, I don't think there's a significant benefit either way, and Plugins are frankly a little more ubiquitous. I could be convinced either way.
Eclipse
Comment #12
dsnopekI think tagged services is actually a really good fit for this problem, because:
Plugins would be better if you needed to only load a named class on demand, or needed multiple instances, or configuration of some kind.
So, my vote would be for tagged services!
Comment #13
phenaproximaLooking at this patch, I also feel that tagged services is a more appropriate fit for the problem, if only because they are simpler than plugins and have less overhead. I see no reason to needlessly complicate this fix. Plugins are maybe more flexible in a general sense, but how much flexibility is really needed here? And +1 what @dsnopek said about there being no need for multiple instances of these classes.
In this case, I favor simplicity over flexibility.
Comment #14
EclipseGc CreditAttribution: EclipseGc commentedYup, I agree with all of that, however, we'll have to invent something if we want to show which services apply to a given node.
Comment #15
Crell CreditAttribution: Crell as a volunteer commentedI don't think we have an information UI for anywhere else that tagged services are used, and it's fine. Not everything needs to have a complex introspection UI built for it. (In fact, many things probably shouldn't.) Worst case, there's always drupal console debug tools, which are already quite handy.
Comment #16
EclipseGc CreditAttribution: EclipseGc commentedI wasn't suggesting anything complex, just a listing page to tell you what's actually applying. You'll forgive me, but I'm quite careful with what I decide is or isn't a tagged service. There are a number of examples in core where someone said "Oh, just make that a tagged service." and I've since been very peeved at my inability to make it do something worth while for end users because of that decision. I'd frankly really like to see a comparison in performance between the two because I see a lot of accusations backed up by exactly 0 links to data.
In short, I'm not suggesting anything complex. I'm favoring the adoption of the most common pattern in core, a potential UI that simply lists what plugins are currently applying (not any sort of configuration) and stats if someone has them.
Eclipse
Comment #17
samuel.mortensonIs this issue ready for review or are we still working out architectural issues? It's hard to track from the comments, I can mark as Needs work if need be.
Comment #18
samuel.mortensonComment #19
samuel.mortensonBump, I have the same pending question as #17. We're doing a new release of Panels next week and it would be good to see this change in, if the patch is ready for review.
Comment #21
japerryAfter discussing with EclipseGC and Phenaproxima, decided that this will go in. If you want a tagged service instead, file a feature request.
Fixed.