Skip to content

Instantly share code, notes, and snippets.

@amcgowanca
Created February 19, 2015 01:36
Show Gist options
  • Save amcgowanca/1f03f89fa2f96a80ff65 to your computer and use it in GitHub Desktop.
Save amcgowanca/1f03f89fa2f96a80ff65 to your computer and use it in GitHub Desktop.
Drupal 7: Patch for panelizer for menu links "disappearing"
diff --git a/plugins/entity/PanelizerEntityNode.class.php b/plugins/entity/PanelizerEntityNode.class.php
index 5ea50a1..14027ce 100644
--- a/plugins/entity/PanelizerEntityNode.class.php
+++ b/plugins/entity/PanelizerEntityNode.class.php
@@ -32,6 +32,9 @@ class PanelizerEntityNode extends PanelizerEntityDefault {
if (isset($entity->workbench_moderation)) {
$entity->workbench_moderation['updating_live_revision'] = TRUE;
}
+ if (!empty($entity->menu['link_title'])) {
+ $entity->menu['enabled'] = TRUE;
+ }
node_save($entity);
}
@amcgowanca
Copy link
Author

An odd behaviour was observed when panelizer was patched for the sake cooperating with the Workbench module in Drupal 7 in which menu links prior to the node_save($entity) that were accessible at node_save($entity) did not contain the element enabled that would be set to TRUE or FALSE. This is one possible solution to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment