Index: kernel/db/cat_event_handler.php =================================================================== --- kernel/db/cat_event_handler.php (revision 14059) +++ kernel/db/cat_event_handler.php (working copy) @@ -2607,24 +2607,32 @@ $file_helper->createItemFiles($event->Prefix, true); // create image fields $file_helper->createItemFiles($event->Prefix, false); // create file fields - - // add EditorsPick to ForcedSorting if needed - $config_mapping = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping'); - if (array_key_exists('ForceEditorPick', $config_mapping) && $this->Application->ConfigValue($config_mapping['ForceEditorPick'])) { + + if ( $this->Application->isAdmin ) { + // schedule to remove Priority and Editors Pick fields from ForcedSorting for Admin + $sorting_keys_to_remove = Array('Priority', 'EditorsPick'); + } + else { + $sorting_keys_to_remove = Array(); + $config_mapping = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping'); + $force_picks = array_key_exists('ForceEditorPick', $config_mapping) && $this->Application->ConfigValue($config_mapping['ForceEditorPick']); + if ( !$force_picks ) { + // schedule to remove Editors Pick fields from ForcedSorting for Front-End + array_push($sorting_keys_to_remove, 'EditorsPick'); + } + } + + // update ListSortings with scheduled to remove sortings + if ( $sorting_keys_to_remove ) { $list_sortings = $this->Application->getUnitOption($event->Prefix, 'ListSortings', Array ()); - - $new_forced_sorting = Array ('EditorsPick' => 'DESC'); - - if (array_key_exists('ForcedSorting', $list_sortings[''])) { - foreach ($list_sortings['']['ForcedSorting'] as $sort_field => $sort_order) { - $new_forced_sorting[$sort_field] = $sort_order; + foreach ($sorting_keys_to_remove as $remove_key) { + if ($list_sortings['']['ForcedSorting'][ $remove_key ] ) { + unset($list_sortings['']['ForcedSorting'][ $remove_key ]); } - } - $list_sortings['']['ForcedSorting'] = $new_forced_sorting; - - $this->Application->setUnitOption($event->Prefix, 'ListSortings', $list_sortings); + } + $this->Application->setUnitOption($event->Prefix, 'ListSortings', $list_sortings); } - + // add grids for advanced view (with primary category column) $grids = $this->Application->getUnitOption($this->Prefix, 'Grids'); $process_grids = Array ('Default', 'Radio');