Index: panels_page/panels_page.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/panels/panels_page/Attic/panels_page.module,v
retrieving revision 1.1.2.48
diff -u -p -r1.1.2.48 panels_page.module
--- panels_page/panels_page.module	27 May 2008 20:21:13 -0000	1.1.2.48
+++ panels_page/panels_page.module	28 May 2008 14:23:21 -0000
@@ -671,20 +671,21 @@ function panels_page_view_page($panel_pa
   $switchers = panels_get_switchers();
   if ($switchers) {
     $list = array();
-    $result = db_query("SELECT name FROM {panels_page} WHERE switcher_name = '%s'");
+    $result = db_query("SELECT name FROM {panels_page} WHERE switcher_name = '%s'", $panel_page->name);
     // get a list of all pages that might switch for this one
     while ($candidate = db_fetch_object($result)) {
       $list[] = $candidate->name;
-    }
+    }    
     if ($list) {
       // separate them based on switcher type
-      $pages = array();
-      foreach (panels_page_load_all($list) as $candidate) {
+      $pages = array();      
+      $candidates = (count($list) > 1) ? panels_page_load_all($list) : array(panels_page_load($list[0]));
+      foreach ($candidates as $candidate) {
         $pages[$candidate->switcher_type][$candidate->name] = $candidate;
       }
-
+      
       // go through switcher types and switch the first one that matches.
-      foreach ($pages as $plugin => $candidates) {
+      foreach($pages as $plugin => $candidates) {
         if ($page = panels_switcher_switch($plugin, 'panel_page', $panel_page->name, $candidates)) {
           $panel_page = $page;
           break;
