From 5e36dd3d0bcc046437ca8ecd0ae144fc33d799a2 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 27 Nov 2016 00:12:59 +0100 Subject: [PATCH] [ticket/9590] Correctly update submit size and replace all forum_id[] PHPBB3-9590 --- phpBB/adm/style/ajax.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js index 64670f9d10..7ddd2d3742 100644 --- a/phpBB/adm/style/ajax.js +++ b/phpBB/adm/style/ajax.js @@ -74,7 +74,7 @@ function submitPermissions() { $submitButton = $form.find('input[type=submit][data-clicked=true]')[0]; // Set proper start values for handling refresh of page - var permissionSubmitSize = formDataSets.length, + var permissionSubmitSize = 0, permissionRequestCount = 0, forumIds = [], permissionSubmitFailed = false; @@ -91,6 +91,8 @@ function submitPermissions() { } }); + permissionSubmitSize = formDataSets.length; + // Add each forum ID to forum ID list to preserve selected forums $.each($form.find('input[type=hidden][name^=forum_id]'), function (key, value) { if (value.name.match(/^forum_id\[([0-9]+)\]$/)) { @@ -119,7 +121,7 @@ function submitPermissions() { // Create form to submit instead of normal "Back to previous page" link if ($alertBoxLink) { // Remove forum_id[] from URL - $alertBoxLink.attr('href', $alertBoxLink.attr('href').replace(/(&forum_id\[\]=[0-9]+)/, '')); + $alertBoxLink.attr('href', $alertBoxLink.attr('href').replace(/(&forum_id\[\]=[0-9]+)/g, '')); var previousPageForm = '
'; $.each(forumIds, function (key, value) { previousPageForm += ''; @@ -142,7 +144,7 @@ function submitPermissions() { setTimeout(function () { // Create forum to submit using POST. This will prevent // exceeding the maximum length of URLs - var form = ''; + var form = ''; $.each(forumIds, function (key, value) { form += ''; });