issue #2390 warn about duplicate paths

This commit is contained in:
plegall
2025-07-24 21:29:38 +02:00
parent fd54a917be
commit bc4acec569
3 changed files with 26 additions and 0 deletions

View File

@@ -3636,6 +3636,30 @@ SELECT
return;
}
}
// search for duplicate paths
$query = '
SELECT
path
FROM '.IMAGES_TABLE.'
GROUP BY path
HAVING COUNT(*) > 1
;';
$duplicate_paths = query2array($query);
if (count($duplicate_paths) > 0)
{
global $template;
$template->assign(
'header_msgs',
array(
l10n('We have found %d duplicate paths. Details provided by plugin Check Uploads', count($duplicate_paths)),
)
);
return;
}
}
/**

View File

@@ -1410,5 +1410,6 @@ $lang['Welcome to %s'] = 'Welcome to %s';
$lang['Save all photos'] = 'Save all photos';
$lang['Use standard Piwigo template for common pages.'] = 'Use standard Piwigo template for common pages.';
$lang['When enabled, a common template is used for the login, registration and forgotten password pages, regardless of the theme. Some themes might use these templates even if you uncheck this option'] = 'When enabled, a common template is used for the login, registration and forgotten password pages, regardless of the theme. Some themes might use these templates even if you uncheck this option';
$lang['We have found %d duplicate paths. Details provided by plugin Check Uploads'] = 'We have found %d duplicate paths. Details provided by plugin Check Uploads';
// Leave this line empty

View File

@@ -1412,4 +1412,5 @@ $lang['Welcome to %s'] = 'Bienvenue sur %s';
$lang['Save all photos'] = 'Enregistrer toutes les photos';
$lang['Use standard Piwigo template for common pages.'] = 'Utiliser le modèle standard de Piwigo pour les pages courantes.';
$lang['When enabled, a common template is used for the login, registration and forgotten password pages, regardless of the theme. Some themes might use these templates even if you uncheck this option'] = 'Lorsque cette option est activée, un modèle commun est utilisé pour les pages de connexion, d\'inscription et de mot de passe oublié, quel que soit le thème. Certains thèmes peuvent utiliser ces modèles même si cette option est décochée.';
$lang['We have found %d duplicate paths. Details provided by plugin Check Uploads'] = 'Nous avons trouvé %d chemins anormalement dupliqués. À contrôler avec le plugin Check Uploads.';
// Leave this line empty