From a3668161ca07f76dc73aaf54aad97ebce70abbb5 Mon Sep 17 00:00:00 2001
From: solotandem <jim@boombatower.com>
Date: Fri, 4 Apr 2014 00:03:40 +0000
Subject: [PATCH 2/2] Issue #2232877: Avoid duplicate processing of menu
 items.

---
 plugins/export_ui/panelizer_defaults_ui.class.php |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/plugins/export_ui/panelizer_defaults_ui.class.php b/plugins/export_ui/panelizer_defaults_ui.class.php
index 061a19e..88c3e48 100644
--- a/plugins/export_ui/panelizer_defaults_ui.class.php
+++ b/plugins/export_ui/panelizer_defaults_ui.class.php
@@ -35,6 +35,11 @@ class panelizer_defaults_ui extends ctools_export_ui {
 
     // Change the callbacks for everything:
     foreach ($this->plugin['menu']['items'] as $key => $item) {
+      if ($this->plugin['menu']['items'][$key]['access callback'] == 'panelizer_has_choice_callback') {
+        // The item has been set; continue to next item to avoid shifting items
+        // onto the page arguments array more than once.
+        continue;
+      }
       $this->plugin['menu']['items'][$key]['access callback'] = 'panelizer_has_choice_callback';
       $this->plugin['menu']['items'][$key]['access arguments'] = array(4, 5, '');
       $this->plugin['menu']['items'][$key]['page callback'] = 'panelizer_export_ui_switcher_page';
-- 
1.7.10.4

