Implementing revisions for Panel-Nodes

Events happening in the community are now at Drupal community events on www.drupal.org.
akriel's picture

Hi,

i am building a website where i want the users to be able to create and edit node-panels with flexible layout.
Also i want to use the same revision features for these node-panels as for normal nodes.

While researching on this topic i found out, that this is not an intended feature. See panels_node.module:

<?php
/**
* Implementation of hook_load().
*
* Panels does not use revisions for nodes because that would open us up
* to have completely separate displays, and we'd have to copy them,
* and that's going to be a LOT of data.
*/
function panels_node_load($node) {
?>

I wonder now how i could add this feature to the node-panels module or if it is possible at all.
As far as i can tell the main problem is, that the revision would not only have to save "simple" body-data like with normal nodes.
Instead in a node-panel revision the layout settings, panes and their content would have to be saved for each revision.

It would be nice if somebody with more knowledge of panels than me could give me some suggestions.
Especially if it is implementable through saving the mentioned data or if this kind of feature is not possible at all.

Thanks and cheers,
Tim

Comments

It's very important

arielkung's picture

I have the same issue here and I think it's a very important !

Any news on this? I

lelizondo's picture

Any news on this? I understand the complexity but this feature would be great

Luis

Yes, it would be graet. My

arielkung's picture

Yes, it would be graet. My team and I relly need it and we can`t do it by our own.

I have the same issue too

lauralv's picture

Any news on this? I think it's a very important !

subscribing, need this as

leanazulyoro's picture

subscribing, need this as well, please implement

I was looking for this stuff

mburak's picture

I was looking for this stuff too! Anyone is taking this? It would be great!

My solution

akriel's picture

Hi,

as there seems to be so much interest in this matter,
i want to share my solution so far. Please be aware that it is not a clean solution and far from being perfect, but maybe it gives a few hints about how revisions for panel nodes are possible.

When saving a panel node through the edit form or through the display editor, i export its display and save it in the body of the node. After that the node revision is saved normally (with the exported display in it's body).

When reverting a node i first delete the display of the current revision and then recreate the old revision. This is done through loading the exported display from the body back to node->export_display and then invoking panel nodes "insert"-hook. That way the display is recreated in the database and the rest of the node can be reverted normally.

Well, as you said, this is

lelizondo's picture

Well, as you said, this is not a clean solution. doesn't have secondary effects like 'Search' indexing all the exported display you have in the body?

Luis

i haven't noticed that yet, as

akriel's picture

i haven't notice that yet, as i'm not using indexing, but that certainly would be a problem.
Also additional secondary effects can not be excluded.

Therefore it would be very helpful if someone who has more knowledge of panels could suggest a cleaner solution.

I doubt that a patch

lelizondo's picture

I doubt that a patch implementing revisions would ever be committed to panels. I haven't heard @merlinofchaos opinion's but the comment he left in code says everything, it is basically a problem with LOT of data. Not that I don't want to see this as a feature, I just don't have a clue of how many data is LOT of data and how that really represents a problem.

Looking at the code, it probably wouldn't be too much of a problem implementing this, but there's a catch, the patch implies a change in the panel_node table and I certainly don't want to have a different table structure than the official one since every patch/bug affecting node_panels could potentially need to be reimplemented.

I guess the best way to do this is ask Earl if he would be interested in implementing this as a feature, but that should be done @D.o

Luis

Any more news on this?

code-brighton's picture

Is revisoning going to become a part of panel nodes content?

If not then it is unusable for my project requirements, which is a shame because the project also requires a flexible page layout, which makes it the obvious choice.

Need it too

avibrazil@gmail.com's picture

Creating a custom Panel with path as node/%nid/!revisions/!vid/!view_or_edit won't work.

Funny that there are some closed bugs/discussions on the Revisioning issue queue about it but I have failed to understand how it works: http://drupal.org/node/519924 and http://drupal.org/node/702344

Panels

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: