Index: branches/5.2.x/core/kernel/db/db_event_handler.php =================================================================== diff -u -r13840 -r14092 --- branches/5.2.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 13840) +++ branches/5.2.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 14092) @@ -1,6 +1,6 @@ mainList = true; } + $object->setGridName( $event->getEventParam('grid') ); + $sql = $this->ListPrepareQuery($event); $sql = $this->Application->ReplaceLanguageTags($sql); $object->setSelectSQL($sql); @@ -999,7 +1001,7 @@ } } - $list_sortings = $this->Application->getUnitOption($event->Prefix, 'ListSortings'); + $list_sortings = $this->Application->getUnitOption($event->Prefix, 'ListSortings', Array ()); $sorting_prefix = array_key_exists($event->Special, $list_sortings) ? $event->Special : ''; $sorting_configs = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping'); @@ -1076,11 +1078,17 @@ * @param string $variable_name * @param string $variable_value */ - function setListSetting(&$event, $variable_name, $variable_value) + function setListSetting(&$event, $variable_name, $variable_value = null) { $view_name = $this->Application->RecallVar($event->getPrefixSpecial() . '_current_view'); // $this->Application->StoreVar($event->getPrefixSpecial() . '_' . $variable_name, $variable_value, true); //true for optional - $this->Application->StorePersistentVar($event->getPrefixSpecial() . '_' . $variable_name . '.' . $view_name, $variable_value, true); //true for optional + + if ( isset($variable_value) ) { + $this->Application->StorePersistentVar($event->getPrefixSpecial() . '_' . $variable_name . '.' . $view_name, $variable_value, true); //true for optional + } + else { + $this->Application->RemovePersistentVar($event->getPrefixSpecial() . '_' . $variable_name . '.' . $view_name); + } } /** @@ -1244,10 +1252,10 @@ */ function OnResetSorting(&$event) { - $this->Application->RemoveVar($event->Prefix_Special.'_Sort1'); - $this->Application->RemoveVar($event->Prefix_Special.'_Sort1_Dir'); - $this->Application->RemoveVar($event->Prefix_Special.'_Sort2'); - $this->Application->RemoveVar($event->Prefix_Special.'_Sort2_Dir'); + $this->setListSetting($event, 'Sort1'); + $this->setListSetting($event, 'Sort1_Dir'); + $this->setListSetting($event, 'Sort2'); + $this->setListSetting($event, 'Sort2_Dir'); } /**