fixes #2316 improve album selector validation and keyboard interaction

also add an error in the global batch manager when we perform an album association but without choosing an album
This commit is contained in:
Linty
2025-01-27 16:08:32 +01:00
parent e985ba5183
commit 1eb083bc63
3 changed files with 44 additions and 19 deletions
+23 -18
View File
@@ -164,28 +164,33 @@ DELETE
if ('associate' == $action)
{
associate_images_to_categories(
$collection,
$_POST['associate']
);
$_SESSION['page_infos'] = array(
l10n('Information data registered in database')
);
// let's refresh the page because we the current set might be modified
if ('no_album' == $page['prefilter'])
if (empty($_POST['associate']))
{
$redirect = true;
}
else if ('no_virtual_album' == $page['prefilter'])
{
$category_info = get_cat_info($_POST['associate']);
if (empty($category_info['dir']))
$page['errors'][] = l10n('Select at least one album');
} else {
associate_images_to_categories(
$collection,
$_POST['associate']
);
$_SESSION['page_infos'] = array(
l10n('Information data registered in database')
);
// let's refresh the page because we the current set might be modified
if ('no_album' == $page['prefilter'])
{
$redirect = true;
}
else if ('no_virtual_album' == $page['prefilter'])
{
$category_info = get_cat_info($_POST['associate']);
if (empty($category_info['dir']))
{
$redirect = true;
}
}
}
}