PHP warning

Undefined array key "sort"

/home/GIR/buggy-motor.ru/protected/modules/catalog/controllers/SiteController.php(225)

213         // $criteria->group = 'item.id';
214 
215         $criteria->distinct = true;
216         $criteria->order = 't.order ';
217 
218         if (isset($_GET['sort'])) {
219             $sort = ($_GET['sort'] == 'asc') ? 'asc' : 'desc';
220             $criteria->order = 'item.price ' . $sort;
221         }
222 
223 
224         if (isset($_GET['sortByCustomField'])) {
225             $sort = ($_GET['sort'] == 'asc') ? 'asc' : 'desc';
226             $criteria->order = 'item.' . $_GET['sortByCustomField'] . ' ' . $sort;
227         }
228 
229         if (isset($_GET['priceMin']) && isset($_GET['priceMax'])) {
230             $priceMin = (int)$_GET['priceMin'];
231             $priceMax = (int)$_GET['priceMax'];
232 
233             $criteria->addBetweenCondition('price', $priceMin, $priceMax);
234         }
235 
236 
237         $dataProvider = new CActiveDataProvider('CatItemsToCat', array('criteria' => array('select' => 't.itemId', 'condition' => '`t`.`catId` in ' . $iDsStr . '', 'with' => 'item', 'order' => '`item`.`top` desc,`item`.`price`', 'distinct' => true, 'group'=>'`t`.`itemId`')));

Stack Trace

#9
+
 /home/GIR/buggy-motor.ru/index.php(14): CApplication->run()
09 defined('YII_DEBUG') or define('YII_DEBUG',true);
10 // specify how many levels of call stack should be shown in each log message
11 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
12 
13 require_once($yii);
14 Yii::createWebApplication($config)->run();
2025-04-01 22:04:27 nginx/1.27.4 Yii Framework/1.1.31-dev