Index: branches/5.1.x/core/admin_templates/categories/categories_edit_permissions.tpl =================================================================== diff -u -N -r13750 -r13825 --- branches/5.1.x/core/admin_templates/categories/categories_edit_permissions.tpl (.../categories_edit_permissions.tpl) (revision 13750) +++ branches/5.1.x/core/admin_templates/categories/categories_edit_permissions.tpl (.../categories_edit_permissions.tpl) (revision 13825) @@ -17,15 +17,15 @@ Request.progressText = ''; Catalog.prototype.AfterInit = function () { - $('#current_group_id').change(); + $('#group_id').change(); } Catalog.prototype.go_to_group = function($group_id) { this.switchTab(); // refresh current item tab } Catalog.prototype.refreshTab = function($prefix, $div_id, $force) { - var $group_id = $('#current_group_id').val(); + var $group_id = $('#group_id').val(); // alert('refreshTab. GroupID: '+$group_id); var $tab_group_id = document.getElementById($div_id).getAttribute('group_id'); if ($group_id != $tab_group_id || $force) { @@ -124,7 +124,7 @@   - @@ -185,15 +185,15 @@ $(document).ready( function() { // last selected group - set_hidden_field('group_id', $('#current_group_id').val()); + set_hidden_field('current_group_id', $('#group_id').val()); - $('#current_group_id').change( + $('#group_id').change( function ($e) { var $group_id = $(this).val(); if ($last_group_id !== false) { // save permissions from previous selected group - set_hidden_field('group_id', $last_group_id); + set_hidden_field('current_group_id', $last_group_id); set_hidden_field('item_prefix', $PermManager.ActivePrefix); $PermManager.submit_event('c', 'OnPreSave', 'categories/permissions_tab'); } @@ -209,4 +209,11 @@ $PermManager.Init(false); } ); + + Application.setHook( + new Array ('c:OnPreSaveAndGoToTab', 'c:OnPreSaveAndGo', 'c:OnSave'), + function($event) { + set_hidden_field('current_group_id', $last_group_id); + } + ); \ No newline at end of file Index: branches/5.1.x/core/units/permissions/permissions_event_handler.php =================================================================== diff -u -N -r13750 -r13825 --- branches/5.1.x/core/units/permissions/permissions_event_handler.php (.../permissions_event_handler.php) (revision 13750) +++ branches/5.1.x/core/units/permissions/permissions_event_handler.php (.../permissions_event_handler.php) (revision 13825) @@ -1,6 +1,6 @@ Application->GetVar('group_id'); + $group_id = $this->Application->GetVar('current_group_id'); $category_id = $this->Application->GetVar('c_id'); $permissions = $this->Application->GetVar($event->getPrefixSpecial(true)); @@ -90,7 +90,7 @@ } $event->MasterEvent->SetRedirectParam('item_prefix', $this->Application->GetVar('item_prefix')); - $event->MasterEvent->SetRedirectParam('group_id', $this->Application->GetVar('current_group_id')); + $event->MasterEvent->SetRedirectParam('group_id', $this->Application->GetVar('group_id')); } /**