Needs work
Project:
Fieldable Panels Panes (FPP)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Oct 2012 at 13:56 UTC
Updated:
25 May 2018 at 21:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
klim_ commentedHave you resolved this issue?
Comment #2
lelizondo commentedThis is whay I did.
First, the problem was that FPP were not being cloned so the same FPP was referenced by the original node and the cloned node. So the solution was actually simple, loop through all the FPP in the original node, then load the FPP entity, create a new one with the same content and assign the new entity to the cloned node.
This is my code:
Comment #4
dimitrov.adrian commentedSeems it's not fixed yet.
I prepare patch that adds and button (on IPE and menu item on panels) that allow user to clone pane's entity.
Comment #6
dimitrov.adrian commentedNew patch that should be applicable.
Comment #7
dimitrov.adrian commentedComment #11
valthebaldAnother approach is to provide cloning functionality in overridden display renderer.
The idea is to clone the pane, then pass it to edit-pane handler.
Patch follows
Comment #12
valthebaldMy bad, missed the function that actually clones a pane
Comment #15
valthebaldI guess testbot couldn't apply the patch because of missing image, fixing
Comment #17
valthebaldReverse patch :(
Comment #18
valthebaldComment #19
vood002 commentedI've stumbled into the need for this and have tried the solution in #2 and the patch in #17 with node_clone but have had no luck.
After cleaning up the typo in the Patch in #17---panles in
count(fieldable_panles_panes_pane_shares($context['pane']->pid))(although truth be told I'm not sure where this function is supposed to exist so I just had to comment this out)--I cloned the node, but when I then cloned and changed a pane in the cloned node it updated the same pane in the source node.I don't completely grasp the overall structure of Panelizer, but my assumption is that node_clone cloned the node but duplicated the same Panels Display, so when I updated the pane in that panels display it updated it in all instances of the display. In this way, #17 may be achieving what it sets out to achieve, but can't be used for my purposes.
I believe the solution in #2, while it looks straight-forward, failed in the same way. The fieldable panels panes were duplicated successfully, but I believe that the cloned node again used the same panels display as the source node, so the source node and cloned node again share the same panels display and when panes are changed on this display they are changed in both instances.
This is a pretty big world to jump into head first but I'm trying to get this code to work. If anyone has any other solutions or thoughts please let me know, otherwise I'm going to continue working in the direction of #2 as it seems to be closest to my end goal.
Comment #20
vood002 commentedIn case anyone stumbles on this conversation I wanted to leave a quick update. #17 does work with a couple of small tweeks mentioned in #19.
The use case of the patch in #17 doesn't apply to me. Essentially I need content authors to have the ability to duplicate an entire panelized page and edit from there. The content authors using the site I'm working on don't have the concept of FPPs as reusable objects as there is no application for that functionality on this project. Thus, the simplest solution for them is to duplicate the node, display, and all of the FPPs on it with a single click.
I make no promises about this below code which I hacked together from #17 and https://www.drupal.org/node/1768746, but it is working for me for this use case, which I have to imagine a lot of people share.
Thanks for the work you put into #17 @valthebald, it looks quite well done to me.
Comment #21
damienmckennaSounds like this needs further work.
Comment #22
roborn commentedPatch on #17 is missing fieldable_panels_panes_pane_shares()
Other than that, is working ok here.
Comment #23
roborn commentedI did run into the issue described on #19, where you edit the cloned pane, and it saves to the original pane.
I've set the panels edit cache before calling the ajax_edit_pane(), and it fixes the issue.
Comment #24
damienmckennaThis needs a little work so that it supports the 'vid:' and 'current:' pane selectors that were added in #1986334: Allow a particular revision of a fieldable panels pane to be placed in a panelized page.
Comment #25
damienmckennaAlso, it might be worth working with #2468263: Copy or clone a fieldable pane so that both approaches use the same logic.
Comment #26
dsnopekIt looks like this issue (based on the issue description) up through comment #2 is about cloning Panelized nodes with FPPs via the 'node_clone', and from comment #4 on it's about cloning individual FPPs in the IPE.
While the latter feature seems cool, we still need to solve the original issue! I'll open a new issue for the original issue, since this seems to have had more activity as the latter.