Unhandled Error!

Uasort() expects parameter 1 to be array, string given

Document /modules/facetedsearch/classes/facetedsearch_search.php
Document type PHP document
Line 614
Exception class Phpr_PhpException

Code Highlight

    	if ( $record_count > 0)
    	{
            //Handle sorting
            $sort_method = isset(FacetedSearch_Class::$n_sort[0]) ? FacetedSearch_Class::$n_sort[0] : 'featured';
 
            if($sort_method == 'featured') {
                uasort(self::$result_array, array('FacetedSearch_Search', 'sort_by_popularity_desc'));
            } else if($sort_method == 'name') {
                uasort(self::$result_array, array('FacetedSearch_Search', 'sort_by_name_asc'));
            } else if($sort_method == 'pricelow') {
                uasort(self::$result_array, array('FacetedSearch_Search', 'sort_by_price_asc'));
            } else if($sort_method == 'pricehigh') {
                uasort(self::$result_array, array('FacetedSearch_Search', 'sort_by_price_desc'));
# Call Stack Code Document Line
17 uasort('a', array(2) [0 => 'FacetedSearch_Search', 1 => 'sort_by_popularity_desc']) /modules/facetedsearch/classes/facetedsearch_search.php 614
16 FacetedSearch_Search::find_products(object(Phpr_Pagination)) /modules/cms/classes/cms_controller.php(383) : eval()'d code 40
15 eval(()) /modules/cms/classes/cms_controller.php 383
14 Cms_Controller->evalWithException('?><? FacetedSearch_Class::build(); $search = FacetedSearch_Class::is_faceted_search(); if(!$search): $this->render_partial('page_404', array('type'=>'search')); else: $sort_options = array( 'featured'=>'Featured', //'bestseller'=>'Best Sellers', //'bestrated'=>'Best Rated', 'name'=>'Name', 'pricelow'=>'Lowest Price', 'pricehigh'=>'Highest Price' ); $view_mode_options = array( 'table'=>array('name'=>'Table', 'title'=>'Three Column View'), 'list'=>array('name'=>'List', 'title'=>'List View'), ); $item_options = array( 12=>'12', 24=>'24', 36=>'36' ); //Process search $perpage = isset(FacetedSearch_Class::$n_item[0]) ? FacetedSearch_Class::$n_item[0] : 24; // Create the pagination object $pagination = new Phpr_Pagination($perpage); $query = ''; $products = FacetedSearch_Search::find_products($pagination); $totalfound = count(FacetedSearch_Search::$result_array); ?> <div class="grid_4"> <div id="attributes"> <div id="narrow_results" class="attribute_group"> Narrow Results </div> <?php $facets = FacetedSearch_Class::get_facets(); foreach($facets as $f) { if( (int)$f['hidden'] ) continue; if($f['entries_count'] > 0) { ?> <div class="attribute_group"> <h4><span>View</span><?php echo h($f['name']); ?></h4> <ul<?php if($f['type']=='list'):?> class="category"<?php endif; ?>> <?php foreach($f['entries'] as $e) { ?> <li><a<?php if(isset($e['selected']) && $e['selected']) { ?> class="selected"<?php } ?> href="<?php echo FacetedSearch_Class::build_url($f, $e); ?>"><?= h($e['name']) ?></a></li> <?php } ?> </ul> </div> <?php } } ?> </div><!-- #attributes --> </div> <div class="grid_12"> <?php $is_search = FacetedSearch_Class::is_search(); $is_category = FacetedSearch_Class::is_category(); $is_brand = FacetedSearch_Class::is_brand(); $is_attribute = FacetedSearch_Class::is_attribute(); //Title builder $titlearr = array(); if( $is_brand ) { $brand_name = array(); $brands = FacetedSearch_Class::get_brand(); foreach($brands as $brand_id=>$brand) { $brand_name[] = $brand['name']; } $titlearr[] = implode(", ", $brand_name); } if( $is_category ) { $category = FacetedSearch_Class::get_category(); $titlearr[] = $category['name']; } if( $is_attribute ) { $attribute_name = array(); $attributes = FacetedSearch_Class::get_attributes(); foreach($attributes as $group_id=>$atrarr) { foreach($atrarr as $atr_id=>$atr) { $attribute_name[] = 'For ' . $atr['name']; } } $titlearr[] = implode(", ", $attribute_name); } if( $is_search ) { $titlearr = array(); $search_name = array(); $searches = FacetedSearch_Class::get_search(); foreach((array)$searches['query'] as $search) { $search_name[] = $search; } $titlearr[] = 'Search Results for "' . implode('", "', $search_name) . '"'; } if( !empty($titlearr) ) { ?> <h1><?= h(implode(" ", $titlearr)) ?></h1> <?php } $bread = FacetedSearch_Class::build_breadcrumb(); $totalbread = count($bread); if( $totalbread > 0 ) { ?> <div id="filter_breadcrumbs"> <div class="selection">Your Selections:</div> <div class="list"> <?php foreach($bread as $br): $class = ( $br['type'] != 'home' ) ? ' class="remove"' : ''; ?> <a<?php echo $class; ?> href="<?php echo $br['url_name']; ?>"><?php echo $br['name']; ?></a> <?php endforeach; ?> </div> </div> <?php } if( $totalfound > 0 ) { ?> <?= open_form() ?> <div class="search_options"> <div class="change_view"> <ul> <li class="title">View Mode</li> <? $default = empty(FacetedSearch_Class::$n_view) ? 'table' : ''; foreach ($view_mode_options as $option_id=>$option): $is_current = ( ( in_array($option_id, FacetedSearch_Class::$n_view) ? true : ( $option_id == $default ? true : false ) ) ); ?> <li title="<?= $option['title'] ?>" class="<?= $option_id ?>"> <?php if( $is_current ) { echo '<span>'; } else { ?> <a href="<?php echo FacetedSearch_Class::build_url(array('id'=>-1), array('id'=>-1, 'name'=>$option['name'], 'url_name'=>$option_id)); ?>"> <?php } echo $option['name']; if( $is_current ) { echo '</span>'; } else { echo '</a>'; } ?> </li> <? endforeach ?> </ul> </div><!-- .change_view --> <div class="page_items"> <ul> <li class="title">Items Per Page</li> <? $default = empty(FacetedSearch_Class::$n_item) ? 24 : ''; foreach ($item_options as $option_id=>$option_name): $is_current = ( ( in_array($option_id, FacetedSearch_Class::$n_item) ? true : ( $option_id == $default ? true : false ) ) ); ?> <li class="<?= $is_current ? 'current' : null ?>"> <? if (!$is_current): ?><a href="<?php echo FacetedSearch_Class::build_url(array('id'=>-3), array('id'=>-3, 'name'=>$option_name, 'url_name'=>$option_id)); ?>"><? endif ?><?= $option_name ?><? if (!$is_current): ?></a><? endif ?> </li> <? endforeach ?> </ul> </div><!-- .page_items --> <div class="item_range"> We found <?php echo number_format($totalfound); ?> items! </div><!-- .page_items --> <div class="sort_by"> <ul> <li class="title">Sort By</li> <? $default = empty(FacetedSearch_Class::$n_sort) ? 'featured' : ''; foreach ($sort_options as $option_id=>$option_name): $is_current = ( ( in_array($option_id, FacetedSearch_Class::$n_sort) ? true : ( $option_id == $default ? true : false ) ) ); ?> <li class="<?= $is_current ? 'current' : null ?>"> <? if (!$is_current): ?><a href="<?php echo FacetedSearch_Class::build_url(array('id'=>-2), array('id'=>-2, 'name'=>$option_name, 'url_name'=>$option_id)); ?>"><? endif ?><?= $option_name ?><? if (!$is_current): ?></a><? endif ?> </li> <? endforeach ?> </ul> </div><!-- .sort_by --> <? if ($pagination): ?> <div class="pagination"> <? $this->render_partial('search_pagination', array('pagination'=>$pagination)); ?> </div><!-- .pagination --> <? endif ?> <div class="clear"></div> </div><!-- .searchoptions --> <div class="clear"></div> <?php $this->render_partial( 'shop:product_search_list', array( 'products'=>$products, 'records_per_page'=>$perpage, 'page_index'=>$this->request_param(1, 0), 'view_mode'=>(isset(FacetedSearch_Class::$n_view) ? implode(" ", FacetedSearch_Class::$n_view) : ''), 'paginate'=>false )); ?> <div class="clear"></div> <div class="search_options"> <div class="sort_by"> <ul> <li class="title">Sort By</li> <? $default = empty(FacetedSearch_Class::$n_sort) ? 'featured' : ''; foreach ($sort_options as $option_id=>$option_name): $is_current = ( ( in_array($option_id, FacetedSearch_Class::$n_sort) ? true : ( $option_id == $default ? true : false ) ) ); ?> <li class="<?= $is_current ? 'current' : null ?>"> <? if (!$is_current): ?><a href="<?php echo FacetedSearch_Class::build_url(array('id'=>-2), array('id'=>-2, 'name'=>$option_name, 'url_name'=>$option_id)); ?>"><? endif ?><?= $option_name ?><? if (!$is_current): ?></a><? endif ?> </li> <? endforeach ?> </ul> </div><!-- .sort_by --> <? if ($pagination): ?> <div class="pagination"> <? $this->render_partial('search_pagination', array('pagination'=>$pagination)); ?> </div><!-- .pagination --> <? endif ?> <div class="clear"></div> </div><!-- .searchoptions --> <div class="clear"></div> <?= close_form() ?> <?php } //end if( $totalfound > 0 ) else { $type = FacetedSearch_Class::is_search() ? 'search' : 'catalog'; $this->render_partial('page_404', array('type'=>$type)); } //end else ?> </div> <div class="clear"></div> <?php endif; //end if a search ?>', 'CMS partial', 'shop:search_products', array(0)) /modules/cms/classes/cms_controller.php 1009
13 Cms_Controller->render_partial('shop:search_products') /modules/cms/classes/cms_controller.php(383) : eval()'d code 3
12 eval(()) /modules/cms/classes/cms_controller.php 383
11 Cms_Controller->evalWithException('?><div id="category_products"> <?php $this->render_partial('shop:search_products'); ?> </div>', 'CMS page', 'Shop') /modules/cms/classes/cms_controller.php 608
10 Cms_Controller->eval_page_content(()) /modules/cms/classes/cms_controller.php 198
9 Cms_Controller->open(object(Cms_Page), array(1) [0 => 'rusch-b-289']) /controllers/application.php 72
8 Application->On404(())
7 call_user_func_array(array(2) [0 => object(Application), 1 => 'On404'], array(0)) /phproad/modules/phpr/classes/phpr_controller.php 170
6 Phpr_Controller->executeAction('On404', array(0)) /phproad/modules/phpr/classes/phpr_controller.php 84
5 Phpr_Controller->_run('On404', array(0)) /phproad/modules/phpr/classes/phpr_response.php 64
4 Phpr_Response->open404(()) /phproad/modules/phpr/classes/phpr_response.php 37
3 Phpr_Response->open('/shop/rusch-b-289') /phproad/system/phproad.php 31
2 include('/srv/www/activehealthsupply.com/public_html/phproad/system/phproad.php') /boot.php 114
1 require_once('/srv/www/activehealthsupply.com/public_html/boot.php') /index.php 3
Warning: mcrypt_enc_get_key_size(): 131 is not a valid MCrypt resource in /srv/www/activehealthsupply.com/public_html/phproad/modules/phpr/classes/phpr_securityframework.php on line 43 Warning: mcrypt_enc_get_iv_size(): 131 is not a valid MCrypt resource in /srv/www/activehealthsupply.com/public_html/phproad/modules/phpr/classes/phpr_securityframework.php on line 54 Warning: mcrypt_create_iv(): Cannot create an IV with a size of less than 1 or greater than 2147483647 in /srv/www/activehealthsupply.com/public_html/phproad/modules/phpr/classes/phpr_securityframework.php on line 54 Warning: mcrypt_generic_init(): 131 is not a valid MCrypt resource in /srv/www/activehealthsupply.com/public_html/phproad/modules/phpr/classes/phpr_securityframework.php on line 56 Warning: mcrypt_generic(): 131 is not a valid MCrypt resource in /srv/www/activehealthsupply.com/public_html/phproad/modules/phpr/classes/phpr_securityframework.php on line 57 Warning: mcrypt_generic_deinit(): 131 is not a valid MCrypt resource in /srv/www/activehealthsupply.com/public_html/phproad/modules/phpr/classes/phpr_securityframework.php on line 58 Fatal error: Exception thrown without a stack frame in Unknown on line 0