Index: branches/5.1.x/core/kernel/db/db_event_handler.php =================================================================== diff -u -r13884 -r13931 --- branches/5.1.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 13884) +++ branches/5.1.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 13931) @@ -1,6 +1,6 @@ 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); + } } /** @@ -1246,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'); } /**