fixes #2396 avoid duplicate image_id in link to manage uploaded photos

This commit is contained in:
plegall
2025-07-31 23:56:40 +02:00
parent d0ac05d951
commit 671657d78b
2 changed files with 2 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ DELETE FROM '.CADDIE_TABLE.'
pwg_query($query);
$inserts = array();
foreach (explode(',', $_GET['batch']) as $image_id)
foreach (array_unique(explode(',', $_GET['batch'])) as $image_id)
{
$inserts[] = array(
'user_id' => $user['id'],

View File

@@ -479,7 +479,7 @@ $(function () {
// pwg.caddie.add(uploadedPhotos) instead of relying on huge GET parameter
// (and remove useless code from admin/photos_add_direct.php)
$(".batchLink").attr("href", "admin.php?page=photos_add&section=direct&batch=" + uploadedPhotos.join(","));
$(".batchLink").attr("href", "admin.php?page=photos_add&section=direct&batch=" + [...new Set(uploadedPhotos)].join(","));
$(".batchLink").html(sprintf(batch_Label, uploadedPhotos.length));
$(".afterUploadActions").show();