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.
| Comment | File | Size | Author |
|---|---|---|---|
| #33 | revisioning_panels_fix_6.x-1.0.zip | 1.09 KB | eriktoyra |
| #12 | revisioning-panels-upd.patch | 10.16 KB | crea |
| #12 | icon_node.png | 460 bytes | crea |
| #5 | revisioning-panels.patch | 7.24 KB | crea |
| #5 | icon_node.png | 460 bytes | crea |
Comments
Comment #1
crea commentedSome news:
Comment #2
rdeboerSorry 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
Comment #3
crea commentedDon'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).
Comment #4
crea commentedI think I will hold this patch not to put additional pressure on you, until you commit my previous patches :)
Comment #5
crea commentedShowtime!
I would like this to be reviewed and committed, as all other things mentioned in first post can be dealt with later.
Patch summary
Comment #6
crea commentedActually 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.
Comment #7
crea commentedWhat 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.
Comment #8
rdeboerWell you have certainly enticed me to check out Panels+CTools in more detail, crea!
Rik
Comment #9
crea commentedHmmm....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.
Comment #10
crea commentedIt'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.
Comment #11
crea commentedOk, I have made CTools access plugin. It turned out to be simple enough.
Comment #12
crea commentedUpdated patch summary
Comment #13
BenK commentedHey 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
Comment #14
crea commentedIt should. It's against the dev version and you can see the post is from aug 15
Comment #15
m_z commentedHi,
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->subjectinto$block->titleafter upgrading my own content types to Panels 3 to make the pane title editable again.Comment #16
crea commented@M_Z Thanks for trying it out, i'll check what you describe.
Comment #17
crea commentedPlease 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.
Comment #18
nickrice commentedFirst:
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.
Comment #19
nickrice commentedOk 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.
Comment #20
crea commentedI think this patch needs work because access plugin format of CTools has changed
Comment #21
crea commentednickrice, I decided to implement my own project without Revisioning so i'm afraid you have to ask someone else
Comment #22
crea commentedComment #23
rdeboerTaken 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
Comment #24
m_z commented@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
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.
Comment #25
PieWie commentedhi
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 1105Comment #26
rdeboer@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.
Comment #27
PieWie commentedok (I had not noticed that it was an old)
i comment this line
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)
Comment #28
m_z commented@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.
Comment #29
PieWie commented@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
Comment #30
m_z commented@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
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;
Comment #31
PieWie commented@M_Z
thanks
I will try to do this
Comment #32
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
Comment #33
eriktoyra commentedHere's a tiny little module doing what M_Z recommended. It sets the variable
page_manager_override_anyway = TRUEwhen 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.
Comment #34
rdeboerThanks 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.
Comment #35
rdeboerPatch of #33 checked into repository (HEAD), that is will be present in 6.x-3.6.
Comment #36
rdeboer#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.
Comment #37
BarisW commentedWorks for me. I needed to uninstall the module which deleted my settings. Would be nice if the code would run during the update process!
Comment #38
crea commentedomg, Rik, learn the hook_update_N ! shame on you :P
Comment #39
rdeboerYou'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!
Comment #40
kirikintha commentedHi 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?
I am just curious, as I never get to use the update hook! Thanks!
Comment #41
bbcI'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!
Comment #42
rdeboerDid you execute update.php ?
Comment #43
Jarada commentedI 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.
Comment #44
robbertnl commentedBBC, 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
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.
Comment #45
dsayswhat commentedHi 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:
That did the trick for me...but I wanted to let you know it's not quite fixed yet....
Comment #46
rdeboerThanks dsayswhat (#45). Yes the functionality you describe is what is intented and I'll attend to it soon.
Nice tip that drush command.
Comment #47
rdeboerpage_manager_override_anywayis now set when upgrading an old version as well as when installing or (re)installing Revisioning.Committed to repository.
Comment #48
rdeboerComment #50
Cool_Goose commentedI confirm this still is an issue with the latest version of revisioning / pages / drupal 6.
You have to run
variable_set('page_manager_override_anyway', TRUE);by hand.Comment #51
anzolnet commentedAfter installing the Revisioning module, the variable can be set by opening the update page, and manually select the revisioning module update 6307.
Comment #52
rdeboerThis 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).
Comment #54
avibrazil@gmail.com commentedAfter 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
Comment #55
m_z commented@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.
Comment #56
BenK commentedHey 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
Comment #57
rdeboerNo 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....
Comment #58
scott.whittaker commentedSubscribe?
Comment #59
acbramley commentedsub,.
Comment #60
acbramley commentedsubscribe.
Comment #61
rdeboerI 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...
Comment #62
aaronbaumanbump
Comment #63
jantoine commentedFor 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