This bug integrates with a lot of modules so my apologies in advance.
If I create an IPE revision of a panelized node and have that revision go into draft mode but then (without refreshing) hit Customize This Page a second time (and save it) all panels go missing.
I've checked and the panels_pane table has no entries for this latest revision. This only happens after creating a new revision from a draft. If I do it from a published revision I don't have the problem. I've traced through the code and it looks like the panelizer cache functions aren't properly receiving the vid of the revision. At this point I can't tell which one of the modules is causing this.
Modules in play: Workbench Moderation, Panels, Panelizer Dev, Panels IPE
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | panelizer-n2408903-8.patch | 5.78 KB | damienmckenna |
Comments
Comment #1
andrew m riley commentedComment #2
damienmckennaComment #3
damienmckennaI closed a duplicate I opened at exactly the same time X-)
I'll need to dig into workbench_moderation a bit.
Comment #4
damienmckennaPatches that are being used with Workbench Moderation:
; Errors on node forms.
; https://www.drupal.org/node/1944058#comment-8415341
projects[workbench_moderation][patch][] = https://www.drupal.org/files/issues/workbench_moderation-indefined-index...
; Support for Pathauto.
; https://www.drupal.org/node/1852244#comment-7235854
projects[workbench_moderation][patch][] = https://www.drupal.org/files/1852244-setting_path_to_default_pathauto_va...
; Alterable node history table.
; https://www.drupal.org/node/1868144#comment-9358421
projects[workbench_moderation][patch][] = https://www.drupal.org/files/issues/workbench_moderation-n1868144-10.patch
Comment #5
damienmckennaA single diff containing the three patches for WM.
Comment #6
damienmckennaIt turns out that this is a duplicate of #2363275: IPE needs to allow for more nuanced save commands, once that patch is applied the visitor will be redirected to 'node/' . $entity->nid . '/current-revision' rather than left on the page they're on.
Comment #7
andrew m riley commentedRe-opening. The it turns out that PanelizerEntityDefault.class.php wasn't taking into account the version id. When I added the vid to the cache_key the missing panels while doing Published -> draft ->draft is resolved.
I also made changes to panelizer with the redirect after save since it wasn't firing off properly. The change I have in the patch is temporary and technically works but I think it could be greatly improved upon. The issue here is the data that is loaded initially is the last published version of the node/entity. In the case of my test it has a default panelizer layout so there is no DID set. When panelizer_form_panels_ipe_edit_control_form_alter() checks for did (empty) it won't set the $form_state['panelizer *'] variables which the panelizer_panels_ipe_ajax_save_commands_alter() checks for. This problem isn't visible if you have a second version of the node published that does have a modified panelizer layout.
Tests
- Fresh node, customize with ipe, save ipe display. It should redirect to the new draft version.
- Node with default panelizer layout and one draft version of a IPE layout change. Add a new draft IPE change. It should redirect to the new draft version.
Comment #8
damienmckennaMinor adjustments - wrapped one of the comments and added a period, changed other cache_key definitions to the same implode(':', array()) structure.
Comment #9
damienmckennaCommitted.