Index: db_event_handler.php =================================================================== --- db_event_handler.php (revision 13861) +++ db_event_handler.php (working copy) @@ -1076,11 +1076,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 +1250,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'); } /**