(I am not 100% sure if this belongs here or in panels)

I would like to expose the "Create new revision" in the IPE interface for changing layouts, so that a layout change could be made without a revision from IPE. This becomes really useful when adding in workbench moderation, so a user change change a layout without waiting for content to be moderated.

Comments

fullerja’s picture

Issue summary: View changes
fullerja’s picture

Issue summary: View changes
damienmckenna’s picture

Component: Code » Revisions
cashwilliams’s picture

I could see this feature being useful as well.

damienmckenna’s picture

Version: 7.x-3.1 » 7.x-3.x-dev
rgristroph’s picture

I took a look at this, I have made a bit of progress but no useful patch yet:

* I added the checkbox for new revision, and the log message text area, to the form when you are switching layouts, by copying that part of the form from node.pages.inc in the core node module.

* But that's not themed like the rest of the form

* And on the backend when you submit it, it doesn't do anything

My plan next is to make the submit function panels_change_layout_submit() in includes/display-layout.inc copy the checkbox value and log message into the $display variable in there, and then I still have to track down where it is actually saved.

--Rob

damienmckenna’s picture

@rgristroph: if you submit what you have we might be able to collaborate.

rgristroph’s picture

StatusFileSize
new3.66 KB

Here's what I have so far. It's a patch to panels, not panelizer, specifically the includes/display-layout.inc file.

In panels_display_save() (in panels.module) the $display now has the info from the form, in $display->revision_information, about if the user wanted to create a new revision or not.

However I'm not sure exactly what to do at that point - it might not be the right place to handle the revisions at all.

I will be at Drupal Camp Asheville this weekend, if you happen to be there we could collaborate in person. I will have time to work on it further on Sunday.

damienmckenna’s picture

Title: Expose "Create new revision" checkbox in IPE » Expose "Create new revision" checkbox in IPE when changing layout
Status: Active » Needs work

The patch provided was for Panels, not Panelizer.

damienmckenna’s picture

Component: Revisions » IPE integration

Moving this to the IPE component.

dsnopek’s picture

Status: Needs work » Needs review
Issue tags: +Needs tests
StatusFileSize
new2.33 KB

Here's a new patch against Panelizer (rather than Panels) which gets revisions for changing the layout in the IPE working for me. I haven't tested it super extensively and it could use some automated tests too.

cboyden’s picture

The patch in #12 is working as expected in my testing.

dsnopek’s picture

Turns out that "Change layout" with creating a new revision causes some bugs in IPE, so this Panels patch is necessary too: #2798831: IPE insufficient for Panelizer with new revisions on "Change layout"

cboyden’s picture

Status: Needs review » Reviewed & tested by the community

Been using this patch, along with the one in #2798831: IPE insufficient for Panelizer with new revisions on "Change layout", for quite a while now and it's working well.

damienmckenna’s picture

That's fantastic, thanks for the update cboyden!

  • DamienMcKenna committed 1813d48 on 7.x-3.x authored by dsnopek
    Issue #2189477 by rgristroph, dsnopek, fullerja, cboyden: Expose "Create...
damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you.

Status: Fixed » Closed (fixed)

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