Author: sevein
Date: Thu May  3 17:44:15 2012
New Revision: 11625

Log:
Check existence of array item to avoid PHP warning

Modified:
   branches/2.0/apps/qubit/modules/search/templates/_facet.php

Modified: branches/2.0/apps/qubit/modules/search/templates/_facet.php
==============================================================================
--- branches/2.0/apps/qubit/modules/search/templates/_facet.php Thu May  3 
17:35:24 2012        (r11624)
+++ branches/2.0/apps/qubit/modules/search/templates/_facet.php Thu May  3 
17:44:15 2012        (r11625)
@@ -13,15 +13,17 @@
           'page' => null) + $sf_request->getParameterHolder()->getAll()) ?>
       </li>
 
-      <?php foreach($pager->facets[$facet]['terms'] as $id => $term): ?>
-        <li <?php if (in_array($id, @$filters[$facet])) echo 'class="active"' 
?>>
-          <?php echo link_to(
-            __($term['term']).'<span>'.$term['count'].'</span>',
-            array(
-              $facet => (@$filters[$facet] ? implode(',', 
array_diff(array_merge(@$filters[$facet], array($id)), 
array_intersect(@$filters[$facet], array($id)))) : $id),
-              'page' => null) + $sf_request->getParameterHolder()->getAll()) ?>
-        </li>
-      <?php endforeach; ?>
+      <?php if (isset($pager->facets[$facet])): ?>
+        <?php foreach($pager->facets[$facet]['terms'] as $id => $term): ?>
+          <li <?php if (in_array($id, @$filters[$facet])) echo 
'class="active"' ?>>
+            <?php echo link_to(
+              __($term['term']).'<span>'.$term['count'].'</span>',
+              array(
+                $facet => (@$filters[$facet] ? implode(',', 
array_diff(array_merge(@$filters[$facet], array($id)), 
array_intersect(@$filters[$facet], array($id)))) : $id),
+                'page' => null) + $sf_request->getParameterHolder()->getAll()) 
?>
+          </li>
+        <?php endforeach; ?>
+      <?php endif; ?>
 
     </ul>
 

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to