aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/adm/style/ajax.js8
1 files 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 = '<form action="' + $alertBoxLink.attr('href') + '" method="post">';
$.each(forumIds, function (key, value) {
previousPageForm += '<input type="text" name="forum_id[]" value="' + value + '" />';
@@ -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 = '<form action="' + res.REFRESH_DATA.url.replace(/(&forum_id\[\]=[0-9]+)/, '') + '" method="post">';
+ var form = '<form action="' + res.REFRESH_DATA.url.replace(/(&forum_id\[\]=[0-9]+)/g, '') + '" method="post">';
$.each(forumIds, function (key, value) {
form += '<input type="text" name="forum_id[]" value="' + value + '" />';
});