mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-02 14:57:37 +02:00
[ticket/9590] Correctly update submit size and replace all forum_id[]
PHPBB3-9590
This commit is contained in:
@@ -74,7 +74,7 @@ function submitPermissions() {
|
|||||||
$submitButton = $form.find('input[type=submit][data-clicked=true]')[0];
|
$submitButton = $form.find('input[type=submit][data-clicked=true]')[0];
|
||||||
|
|
||||||
// Set proper start values for handling refresh of page
|
// Set proper start values for handling refresh of page
|
||||||
var permissionSubmitSize = formDataSets.length,
|
var permissionSubmitSize = 0,
|
||||||
permissionRequestCount = 0,
|
permissionRequestCount = 0,
|
||||||
forumIds = [],
|
forumIds = [],
|
||||||
permissionSubmitFailed = false;
|
permissionSubmitFailed = false;
|
||||||
@@ -91,6 +91,8 @@ function submitPermissions() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
permissionSubmitSize = formDataSets.length;
|
||||||
|
|
||||||
// Add each forum ID to forum ID list to preserve selected forums
|
// Add each forum ID to forum ID list to preserve selected forums
|
||||||
$.each($form.find('input[type=hidden][name^=forum_id]'), function (key, value) {
|
$.each($form.find('input[type=hidden][name^=forum_id]'), function (key, value) {
|
||||||
if (value.name.match(/^forum_id\[([0-9]+)\]$/)) {
|
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
|
// Create form to submit instead of normal "Back to previous page" link
|
||||||
if ($alertBoxLink) {
|
if ($alertBoxLink) {
|
||||||
// Remove forum_id[] from URL
|
// 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">';
|
var previousPageForm = '<form action="' + $alertBoxLink.attr('href') + '" method="post">';
|
||||||
$.each(forumIds, function (key, value) {
|
$.each(forumIds, function (key, value) {
|
||||||
previousPageForm += '<input type="text" name="forum_id[]" value="' + value + '" />';
|
previousPageForm += '<input type="text" name="forum_id[]" value="' + value + '" />';
|
||||||
@@ -142,7 +144,7 @@ function submitPermissions() {
|
|||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
// Create forum to submit using POST. This will prevent
|
// Create forum to submit using POST. This will prevent
|
||||||
// exceeding the maximum length of URLs
|
// 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) {
|
$.each(forumIds, function (key, value) {
|
||||||
form += '<input type="text" name="forum_id[]" value="' + value + '" />';
|
form += '<input type="text" name="forum_id[]" value="' + value + '" />';
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user