I'm making Panels integration for Revisioning. Basically it will allow to output revisions as Panel Pages instead of node.tpl.php and it is just great.
Currently I implemented "node revision view" task which allows to attach panel page to path "node/%node/revisions/%vid/view" instead of "node_page_view".
There are some issues still - like access control stuff - Panels use Ctools "access plugins" and I'm not sure if currently our "node revision view" task use proper access callback - probably Ctools overwrites that with it's own, so we need to implement our access plugin. I will investigate that.
I have some ideas of what else could be implemented:

  • make %vid as additional "context" so it would be possible to use it in titles, for example
  • make additional Ctools "content types" (for end user these are just panes) as option of alerting user about currently viewed revision and workflow stuff
  • make additional Ctools "content types" to output revision tasks as panes, instead (or as addition ?) of local tasks
  • I don't like how "compare to current" outputs current revision below diff, cause it uses template and I want to output revision as Panel or to hide it completely. Basically, I just don't want to make node templates just for that diff page. So we probably need to have "compare to current" as Panel Page too

I will post patch implementing this soon, after I investigate access stuff. I'm interested in your ideas of Panels integration features.

Comments

crea’s picture

Some news:

  • I also implemented "Revision Information" content type (Panel Pane) that outputs revision information about loaded revision of node context. So together with patch in #516404: Module rework and Rules integration it would be possible disable revision alerts made via drupal_set_message(), and output them in Panel Pane instead.
  • As for "compare to current" Diff page I opened issue #521212: Make diff comparison page themable at Diff queue. Let's hope it will be fixed in Diff module so we wouldn't need to have our own version of diff_diffs_show() function
RdeBoer’s picture

Sorry crea,
Love your work!
... but cannot keep up with you at the moment....
I have a lot on my plate outside of Drupal as well as within.... including the launch of two new modules.
I do hope to release some of the recent Revisioning patches, including yours, in the next few days...
Keep up the good work!
Rik

crea’s picture

Don't worry, this Panels integration only adds 1 small function and the rest lies in separate plugin files. So it will be very easy both for me to reroll against any Revisioning release and for you to review and commit. I can even release this as separate module (but would prefer not to).

crea’s picture

I think I will hold this patch not to put additional pressure on you, until you commit my previous patches :)

crea’s picture

Status:Active» Needs review
StatusFileSize
new460 bytes
new7.24 KB

Showtime!
I would like this to be reviewed and committed, as all other things mentioned in first post can be dealt with later.

Patch summary

  1. New "revision view" Page Manager task that overwrites own Revisioning menu path "node/%node/revisions/%vid/view". It can be used to view any revision as Panels Page, allowing very flexible layouts.
  2. "Revision info" Ctools content type (panels pane) that prints information about revision of %node context. It can be useful to output revision information if you also uncheck corresponding checkbox in Revisioning admin settings.
crea’s picture

Status:Needs review» Needs work

Actually there is access control missing still - I forgot about it. Setting to nw until I sort this out. Meanwhile I encourage to test it, e.g play with it on test site.

crea’s picture

Status:Needs work» Needs review

What is cool with Panels/CTools combo, there is so much implemented, so once you integrate with it, you can sit back and let do most of the job for you. This patch does not need access control, because there is access control in Panels /Ctools integrated: when using custom panes or tasks, you can set up "visibility rules" with the following method. Set up "only one criteria must pass" and add 2 checks: first, if current user has "view revisions" permision, second, if current user has "view revisions of own content" permission. So resulting check (performed by CTools ofcourse!) will be like this:
If current user has "view revisions" or "view revisions of own content" permission => GRANT ACCESS.
Setting this patch to "needs review" because of that.

RdeBoer’s picture

Well you have certainly enticed me to check out Panels+CTools in more detail, crea!
Rik

crea’s picture

Status:Needs review» Needs work

Hmmm....I'm doing stupid things..
Combo permission check I listed before doesn't check if current user == author in case of "view own content permission" :(
I will try to investigate how to do it with minimum of work.

crea’s picture

It's possible to use PHP code as access check, but it seems like wrong solution: we can't ask every user to enter PHP. Let's wait what Earl Miles got to say to us.. See #547268: Allow to combine visibility rules using several different logical operations.

crea’s picture

Ok, I have made CTools access plugin. It turned out to be simple enough.

crea’s picture

Status:Needs work» Needs review
StatusFileSize
new460 bytes
new10.16 KB

Updated patch summary

  1. New "revision view" Page Manager task that overwrites own Revisioning menu path "node/%node/revisions/%vid/view". It can be used to view any revision as Panels Page, allowing very flexible layouts.
  2. "Revision info" CTools content type (panels pane) that prints information about revision of %node context. It can be useful to output revision information if you also uncheck corresponding checkbox in Revisioning admin settings. This content type needs icon to show in Panels interface so I just used one from node content, but we can replace it with better icon later.
  3. New CTools access plugin "User can view revisions of the node". Basically it does same checks as in #549414: Even more granular "view revisions" permissions. patch, only for node and user extracted from CTools contexts. So now Panels integration depends on #549414: Even more granular "view revisions" permissions.. This access check should be used in "visibility rules" of Panels to show revision information only to users with proper permissions.
BenK’s picture

Hey crea and Rik,

I'm very interested in this panels integration.... a great way to allow more flexible layouts. I'm interested in doing some testing to move the process forward. Will the updated patch in #12 work if applied against the latest 6.x-2.x-dev version (2009-Aug-03)?

Thanks!

--Ben

crea’s picture

It should. It's against the dev version and you can see the post is from aug 15

M_Z’s picture

Hi,

good work.

@crea: Please check if the title of your 'revision_info' pane can be overwritten by user-defined title via panels administration.
I had to change $block->subject into $block->title after upgrading my own content types to Panels 3 to make the pane title editable again.

crea’s picture

@M_Z Thanks for trying it out, i'll check what you describe.

crea’s picture

Please also test following: if this patch is applied, what happens if you don't use "Revision view" page manager tasks, i.e. don't create panel for it ? Does "view revision" page retain all it's properties (most important, access control) ? We need to make sure everything works same as without this patch, if user has Panels module but doesn't want to use it for revisions.

nickrice’s picture

First:
This patch (along with the revisioning module itself, of course) provides exactly what I was looking for and has made me very happy!!! Thanks crea.

wrt testing (as per #17):
I'm using the patch from #12 applied to revisioning 6.x.2.7.

When I disable the panel (by changing the selection rule - no "disable" link is shown on the main panels page) the revision reverts to appearing as it did before applying the patch.

I can't say anything about access control at the moment because that's something I learning about at the moment and haven't really yet got it all sorted anyway.

nickrice’s picture

Ok I'm sort of hoping this is a simple dimple 2 minute job that you'll be happy to add in to the patch ...

As well as wanting nodes and revisions to look similar when a user views them, which I can now do with the patch, I also want their experience of editing a node versus revision to be similar.

I've only given the node_edit system panel page a cursory look so far, but it seems to be the right tool for making the node edit / creation page more friendly for the user.

The equivalent for revisions would be /node/%node/revisions/%vid/edit.

Is that something you'd be happy to add in, Andrey?

Thanks,
Nick.

crea’s picture

Status:Needs review» Needs work

I think this patch needs work because access plugin format of CTools has changed

crea’s picture

nickrice, I decided to implement my own project without Revisioning so i'm afraid you have to ask someone else

crea’s picture

Assigned:crea» Unassigned
RdeBoer’s picture

Taken from: #718394: suport for panels , by PieWie:
See also: #702344: Revisioning prevents Panels from overriding node/%nid page
---------------------------------------------------------
Hi all

when can we expect support for the module Panels

because when i try to enable the module revisionig
the panels exclude (corresponding nod - Node template)

When I try to once again turn panels receive the following message:

Page manager module is unable to enable node/%node because some other module already has overridden with _revision_view.

this is when you try to enable "Node template"

I used
Revisioning 6.x-3.4
Views 6.x-3.x-dev (2009-sie.-12)
Panels 6.x-3.3

M_Z’s picture

@RdeBoer:
The reason is a 'security behavior' of Panels (resp. CTools' Page Manager which offers the default tasks like "Node template").

Please look at file:
ctools\page_manager\plugins\tasks\node_view.inc

  // Override the node view handler for our purpose.
  $callback = $items['node/%node']['page callback'];
  if ($callback == 'node_page_view' || variable_get('page_manager_override_anyway', FALSE)) {
...

The page callback for path 'node/%node' must be 'node_page_view' or you must set 'page_manager_override_anyway' variable to TRUE.
Trying the 2nd option (that means creating a new variable entry with value TRUE) should solve your problem.

Good luck.

PieWie’s picture

hi

i installed patch #12
after the operation, I get the following error

Fatal error: Cannot redeclare revisioning_ctools_plugin_directory() (previously declared in /sites/all/modules/revisioning/revisioning.module:1090) in /sites/all/modules/revisioning/revisioning.module on line 1105

RdeBoer’s picture

@PieWie, #25
That patch is really old and may not apply to the recent versions of Revisioning and Panels.
We may need something along the lines of what M_Z describes in #24.

PieWie’s picture

ok (I had not noticed that it was an old)

i comment this line

//$items['node/%node']['page callback'] = $items['node/%node/view']['page callback'] = '_revision_view';
//$items['node/%node']['page arguments'] = $items['node/%node/view']['page arguments'] = array(1);

and that seems to work for "nod themple" (node/%node)

now looking for line to work with "Node add/edit form" (node/add/%node_type and node/%node/edit)

M_Z’s picture

@PieWie:
(A) Commenting the 2 lines in #27 can lead to unwanted behavior (e.g. if you create a variant (= Panels display) for "node template" with some Selection rule --> then all nodes which fail this selection rule will result in a "wrong" page callback - in your example above this would be 'node_page_view' instead of '_revision_view').

(B) I would suggest the following solution: Put variable_set('page_manager_override_anyway', TRUE); in your *.install file to set this variable, when your module is enabled.

In the code that I posted in #24 your solution (A) ensures the left "OR"-condition in the if-statement, but my suggestion (B) uses the right "OR"-condition.

PieWie’s picture

@M_Z thank for the information
if you could write exactly what and where I write (but step by step)
unfortunately I'm not a programmer

M_Z’s picture

@PieWie:

Option 1:
Create your own custom module (there are many tutorials out there - only 3 files: .info, .module and .install) and place the following code into .install file

/**
* Implementation of hook_install().
*/
function YOURMODULENAME_install() {
  variable_set('page_manager_override_anyway', TRUE);
}

Upload your custom module and enable it. That's it.

Option 2 (not recommended):
Go to your Drupal database (e.g. by using phpMyAdmin) and add a new row in the variable table with name = page_manager_override_anyway and value = b:1;

PieWie’s picture

@M_Z
thanks
I will try to do this

RdeBoer’s picture

Version:6.x-2.x-dev» 6.x-3.4
Assigned:Unassigned» RdeBoer

@M_Z, PieWie
Thanks for your investigations. I don't have the time myself at the moment.
If this works for you without any side-effects, I'll include a similar solution in Revisioning.
Please report back on how you went, confirming Revisioning version number (I assume it's the latest?).
Rik

eriktoyra’s picture

Title:Panels integration» Module taking care of this
StatusFileSize
new1.09 KB

Here's a tiny little module doing what M_Z recommended. It sets the variable page_manager_override_anyway = TRUE when installed and deletes the same variable when uninstalled. A quick and dirty solution while we wait for a more permanent solution, but it works.

Edit: This fix has been tested with Revisioning 6.x-3.4 together with Panels 6.x-3.3.

RdeBoer’s picture

Title:Module taking care of this» Panels integration fix
Category:task» feature
Status:Needs work» Needs review

Thanks M_Z, Erik. If that's all there is to it, then we should be able to roll something like this out as part of the next release of Revisioning soon.

RdeBoer’s picture

Patch of #33 checked into repository (HEAD), that is will be present in 6.x-3.6.

RdeBoer’s picture

#33 now in 6.x-3.6. For those who already have Revisioning installed, you need to disable, uninstall and re-enable it, as the code is run once, upon installation.

BarisW’s picture

Works for me. I needed to uninstall the module which deleted my settings. Would be nice if the code would run during the update process!

crea’s picture

omg, Rik, learn the hook_update_N ! shame on you :P

RdeBoer’s picture

You're right crea... I forget about that one. I will better my ways... Good to have someone like you to look over my shoulder, my guardian angel!

kirikintha’s picture

Hi everyone! Thanks so much for such a tasty module!

I just downloaded Revisioning 6.x-3.9 installed, and still had the panels security warning after install. I then disabled/re-enabled the module and it worked as expected! No extra coding required.

Do you think this would work?

function revisioning_update_6307() {
  $ret = array();
  // Panels override fix, see http://drupal.org/node/519924#comment-2617370.
  variable_set('page_manager_override_anyway', TRUE);
  module_disable('revisioning');
  module_enable('revisioning');
  return $ret;
}

I am just curious, as I never get to use the update hook! Thanks!

BBC’s picture

I'm running Revisioning 6.x-3.11 with Panels 6.x-3.7 on a and haven't had any luck getting rid of the "Page manager module is unable to enable node/%node because some other module already has overridden with _revisioning_view" error.

Disabling, uninstalling and re-enabling Revisioning didn't do the trick for me.

Any suggestions? I've been using Revisioning for some time, but am new to Panels. Both modules are on the critical path for the site I'm currently working on. Thanks!

RdeBoer’s picture

Did you execute update.php ?

Jarada’s picture

I have tried all of the above, disabling and re-enabling, uninstalling and reinstalling, visiting update.php (which didn't have any updates to share), standing on one foot and touching my head while doing all of them again, and am still getting the same error with the latest versions: Revisioning 6.x-3.11 and Panels 6.x-3.7.

Only played around with revisions, mind, as I had installed Panels first.

robbertnl’s picture

BBC, you still have to set the override to TRUE.
You can do that with the modules listed before or:
-make a new page
-set input format to php
-type

<?php
 variable_set
('page_manager_override_anyway', TRUE);
?>

Save and view the page. After this you can delete this page and the error should disappear when enabling the node template in panels.

dsayswhat’s picture

Hi all -

I just installed revisioning last week for the site I'm working on...and I got the error, under discussion here, despite the fresh install of 6.x-3.11.

If I'm not mistaken, the variable_set call needs to be in both revisioning_install and revisioning_update_6307, so that new installs get it by default, and folks upgrading their existing install get it too.

However, there's another quick workaround...I used drush to set the variable like so:

drush vset page_manager_override_anyway 1

That did the trick for me...but I wanted to let you know it's not quite fixed yet....

RdeBoer’s picture

Thanks dsayswhat (#45). Yes the functionality you describe is what is intented and I'll attend to it soon.
Nice tip that drush command.

RdeBoer’s picture

page_manager_override_anyway is now set when upgrading an old version as well as when installing or (re)installing Revisioning.
Committed to repository.

RdeBoer’s picture

Version:6.x-3.4» 6.x-3.11
Status:Needs review» Fixed

Status:Fixed» Closed (fixed)

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

Cool_Goose’s picture

Status:Closed (fixed)» Active

I confirm this still is an issue with the latest version of revisioning / pages / drupal 6.

You have to run

<?php
 variable_set
('page_manager_override_anyway', TRUE); 
?>

by hand.

anzolnet’s picture

After installing the Revisioning module, the variable can be set by opening the update page, and manually select the revisioning module update 6307.

RdeBoer’s picture

Status:Active» Fixed

This is fixed on the master branch, so for those who know how to use Git it's available.
It will also be available in the long overdue upgrade, 6.x-3.12, which I will release within a few days.... honest :-)
The master branch also fixes #803112: Revision for translated node (thanks sdelbosc).

Status:Fixed» Closed (fixed)

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

aviram’s picture

After reading all 53 comments it is still not clear if the page_manager_override_anyway stuff will integrate Revisioning into Panels (i.e. let us use Panels to display /node/NID/revisions/VID content) or just let Panels and Revisioning be installed on same site without one complaining about the other (but without further integration).

Would somebody please clarify ?

If a deep integration is not ready, could somebody point me to the issue that discusses it, possibly with newer patches as the one provided by crea at #12 above ?

Thank you in advance

M_Z’s picture

@aviram:

As statet in #12 the path is "node/%node/revisions/%vid/view" and the patch provides a "deep integration" between Revisioning and Panels (i.e. let us use Panels to display /node/NID/revisions/VID content).
But I am not sure, if it works with current Revisioning version, because I tested it with the deprecated 2.x branch of Revisioning module.
Maybe this could help you.

BenK’s picture

Version:6.x-3.11» 7.x-1.0-beta8
Status:Closed (fixed)» Active

Hey Rik and everyone,

Sorry to re-open this issue, but I'm currently testing the latest 7.x-1.x-dev version and I don't see Panels integration support (as described on this thread) anywhere in the module. Has this Panels integration functionality (allowing panels to override the display of a revision) been ported to the D7 version?

Thanks,
Ben

RdeBoer’s picture

No there is no Panels integration support yet.
Only a shallow integration was implemented, in that you shouldn't get an error message like this: Page manager module is unable to enable node/%node because some other module already has overridden with....

scott.whittaker’s picture

Subscribe?

acbramley’s picture

sub,.

acbramley’s picture

subscribe.

RdeBoer’s picture

Version:7.x-1.0-beta8» 7.x-1.2

I realise this is long overdue. It's at the top of my list and I hope to find some time before the end of the year (that's 2011, haha not 2012).
But it's a big item.
And I've never liked Panels...

aaronbauman’s picture

Version:7.x-1.2» 7.x-1.x-dev

bump

jantoine’s picture

Status:Active» Fixed

For others looking for a current solution who come across this issue, check this issue out: #515518: Optional node revision task handler to override default behavior

Status:Fixed» Closed (fixed)
Issue tags:-panels

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