I needed to override node/%node/revisions/%vid/view page with Panels and noticed comment in node_view.inc file:

 // @todo override node revision handler as well?

Are you going to implement it ? Would be nice to know so I don't duplicate your effort. Also i'm interested to know how you're going to implement it in detail, because it needs to play well with Revisioning module (because in "revisioning" module we implemented lots of custom revision tasks as "menu local task" items)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

I don't have specific plans to work on it. It's a question in there because I"m not sure that the override is needed. If it is, then it should be implemented. Which means we need to work in the right way to do it.

Care to submit a patch?

crea’s picture

Ofcourse that override is needed, for 2 reasons:
1) If someone uses Panels as means for theming, he will also expect to output revisions same way as node (->current revision)
2) one can't add custom panel with same path, because he will get error mentioning existing menu path.

I will try to make patch, if I fix my problem with some of my menu local tasks messing inside panels.
I guess I will then need to start with node_view.inc task handler as example

crea’s picture

In Revisioning module we have menu local tasks with path like "node/%node/revisions/%vid/taskname" rendered as secondary tabs for "node/%node/revisions" page. If I implement task handler for path "node/%node/revisions/%vid/view" will Revisioning local tasks appear on Panel page served by that handler same way - i.e. as secondary tabs - siblings of "view" task ? And will then Panel page with served by that handler appear as active (open) secondary tab too ? Am I clear enough ? :)

I think there can be some problem cause in Revisioning we need to be sure path "node/%node/revisions/%vid/view" works same way with and without Panels. Will having Revisioning module weight higher than CTools help ?

I have one more idea: we can implement that handler in Revisioning itself or in integration module (like Revisioning Panels) and not in Panels(Ctools) as it seems it would then be easier to make it work together

EDIT:Will moving task handler plugin to Revisioning itself help ? It seems menu altering will be managed by Page Manager itself, in plugin we just declare what needs to be altered. Problem is in Revisioning we already have override for "node/%node/revisions/%vid/view" so am I right Page Manager won't allow to override that menu path again if it's overriden already ? How do we sort this out ?

crea’s picture

Category: feature » support
crea’s picture

Project: Panels » Chaos Tool Suite (ctools)
Version: 6.x-3.x-dev » 6.x-1.0-beta4
crea’s picture

Status: Active » Fixed

I decided to implement it in Revisioning module. Seems like perfect fit, since it has to work with same menu path as Revisioning menu item, so we don't need to care about module weights, who declares first and who alters, and something like that. I'll reopen this if I will have any problems :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dsayswhat’s picture

Version: 6.x-1.0-beta4 » 6.x-1.8
Component: Code » Page Manager
Assigned: Unassigned » dsayswhat
Category: support » feature
Status: Closed (fixed) » Needs review
FileSize
6.35 KB
6.35 KB

It's my belief that we need this in ctools, independant of the revisioning module. My use for node revisions is typically in the context of editorial workflow and approvals.

I've hijacked the patch provided in revisioning #519924: Panels integration fix and moved the node revisions task handler it into page manager - I've got it working for both 6 and 7 - only a couple of small tweaks were needed, but it certainly needs review.

The problem of overrides to the node revisions page handler by other modules needs addressing, and there are surely other aspects that someone more knowledgeable with ctools and its conventions should weigh in on.

If you can recommend further changes, I'm happy to make them.

zroger’s picture

Version: 6.x-1.8 » 7.x-1.x-dev
Status: Needs review » Reviewed & tested by the community

The 7.x patch works well for me. I am using Panelizer and State Machine to create panels-based node layouts with revision-based workflows. This task plugin makes it so that revisions are able to be previewed on the revisions page.

Aside: For anyone trying to use this with panelizer, I had to manually add the panelizer task handler to this task after enabling it.

zroger’s picture

Status: Reviewed & tested by the community » Needs work

Scratch that.

Why does this task try to override node/%node and node/%node/view also? This makes it so that the the standard node_view task cannot be enabled. Removing the those overrides from the menu_alter works for me.

merlinofchaos’s picture

Yeah it shouldn't do both.

dsayswhat’s picture

hmmm. In my use case, I wanted revisions to preview just like normal nodes. If revisions are to look just like normal nodes, then separating the node page handler from revision page handlers isn't desirable. You'd just have to keep them the same by hand, and that's a maintainability problem.

I've had clients asking "why don't my drafts have the same layout as my published versions?" enough times that it seemed like a reasonable default for the use cases I typically see.

That said, I can guess that the rest of the world might differ from those constraints. Is it possible that we provide a config option that allows for admins to decide if they want to use the revision handler for node/nid as well as node/nid/revision/vid? Merlin, what would you recommend?

I'd be happy to implement a solution that makes sense to everyone involved...

merlinofchaos’s picture

It seems like it could be a config option to just inherit the node_view task handlers or not. Most of the time that's probably what you want; but you don't want to redefine node_view, I wouldn't think.

LSU_JBob’s picture

I applied the D7 patch to my D7 instance but was getting 500 errors when saving nodes. I found out that the patch is telling ctools to call the callback "_page_manager_view_revision", but in the patch, nobody wrote the function... why would you refer to a callback and not write it???

Also, the paths in the patch make it so you have to apply the patch from your drupal docroot, I updated the patch so it reflects that we're working from the root of the ctools project.

azinck’s picture

This patch is better for my use-case. This doesn't override node/%node anymore, and removes the call to _page_manager_view_revision in favor of a call directly to node_page_view

takim’s picture

Version: 7.x-1.x-dev » 7.x-1.1
Assigned: dsayswhat » takim
Category: feature » task
Status: Needs work » Patch (to be ported)

Updated the last patch. file, page_manager_node_revision_view_disabled needs to be set False , otherwise user has to make "Node revision view" Disabled/Enabled for first time to make work the last patch.

Project page path is more general so that it should work for everyone. Place the patch under ctool module and apply the Patch.

takim’s picture

Updated the last patch. file, page_manager_node_revision_view_disabled needs to be set False , otherwise user has to make "Node revision view" Disabled/Enabled for first time to make work the last patch.

Project page path is more general so that it should work for everyone. Place the patch under ctool module and apply the Patch.

takim’s picture

Updated the last patch. file, page_manager_node_revision_view_disabled needs to be set False , otherwise user has to make "Node revision view" Disabled/Enabled for first time to make work the last patch.

Project page path is more general so that it should work for everyone. Place the patch under ctool module and apply the Patch.

takim’s picture

Updated the last patch. file, page_manager_node_revision_view_disabled needs to be set False , otherwise user has to make "Node revision view" Disabled/Enabled for first time to make work the last patch.

Project page path is more general so that it should work for everyone. Place the patch under ctool module and apply the Patch.

takim’s picture

Updated the last patch. file, page_manager_node_revision_view_disabled needs to be set False , otherwise user has to make "Node revision view" Disabled/Enabled for first time to make work the last patch.

Project page path is more general so that it should work for everyone. Place the patch under ctool module and apply the Patch.

azinck’s picture

Thanks for re-rolling the patch to fix my crufty paths.

I don't think we want to have the handler enabled by default. While the people following this issue of course want the Node Revision handler enabled for their use-cases, keep in mind that this patch is for CTools more generally. The mere act of enabling Page Manager should not automatically override node revision rendering (you'll note that none of the other handlers -- user, node, etc. -- are enabled by default).

azinck’s picture

Status: Patch (to be ported) » Needs review
DamienMcKenna’s picture

Shouldn't this basically be a mirror of the current node action that just loads a specific revision, rather than a whole extra page handler unto itself? I'd imagine that's what most people would want, right? So, yes, this provides a new handler for the node/%node/revision/%/view path, but I don't think most people will want that.

DamienMcKenna’s picture

FYI I created a sandbox project that lets you display node revisions using the Page Manager handler that's currently configured for node_view: http://drupal.org/sandbox/damienmckenna/1821404

azinck’s picture

@DamienMcKenna:

Seems like the cleanest way to integrate your project would be to just add it to the node_view task handler? I don't have any problem with that but wonder if there are use-cases for configuring/managing the node view and revision view handlers separately.

Barto.G’s picture

I have tried the patch from @azinck #20 and it didn't override the page at first. Then after disabling and enabling again it just gave me a "no access page" (site is in french so i can't remember what's actual english sentence by default)

So i removed the patch and used the sandbox module made by @DamienMcKenna and It works brilliantly. All it does is using the panel made for your nodes (which is what you'd expect).

jantoine’s picture

Sandbox project in #24 is fantastic... Thanks!

jantoine’s picture

Sandbox project in #24 is fantastic... Thanks!

acbramley’s picture

Sandbox in #24 works perfectly, only thing left is to make menu_block display on the revision pages which I've created an issue for #2173749: Allow display of menu block on node revision pages

DamienMcKenna’s picture

Title: Node revision task handler » Optional node revision task handler to override default behavior
Assigned: takim » Unassigned
Issue summary: View changes
Status: Needs review » Needs work

@azinck: This whole thing needs to be split in two: 1) a default configuration that allows the node revision to be displayed with the node_view handler, 2) a new node_revision handler for the small number of sites that want to display something differently.

So lets focus our efforts on #1820882: Make node revisions use the node_view display to cover the default use case, and this one to cover the optional customization for sites that need it.

Pushing this back to "needs work" as it shouldn't be trying to change the node_view handler.

hershey.k’s picture

Any update on this since last comment #30? I have tested the patches in this ticket as well as the one in #1820882: Make node revisions use the node_view display in the Ctools and Revisioning modules and my revision view path /node/%nid/revisions/%/view still displays the default "manage display" settings from the CT instead of displaying the custom Panels Page override of the /node/%nid display that I have in place for that CT. I tested on several types of CT's that I have a panels page manager custom display for.

delacosta456’s picture

hi
#15 works better for me too

thanks

delacosta456’s picture

@hershy.k

did you find solution ?

rivimey’s picture

It seems to me that this is a near duplicate of #1820882: Make node revisions use the node_view display.

It seems the remaining task is #30: "2) a new node_revision handler for the small number of sites that want to display something differently."

... and that it hasn't been done yet. Could those who are interested please comment and, preferably, submit a patch?