mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/9590] Correctly update submit size and replace all forum_id[]
PHPBB3-9590
This commit is contained in:
parent
0f46d35f75
commit
5e36dd3d0b
1 changed files with 5 additions and 3 deletions
|
@ -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 + '" />';
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue