Skip to content
Permalink
Browse files

fixes #1090 move warning about missing checksums from dashboard to sy…

…nc page

* avoid scaring users for a minor issue
* convert the warning message into a simple info
* simplify algorithm for detection and only search on relevant pages (batch manager + sync page)
  • Loading branch information...
plegall committed Oct 14, 2019
1 parent 9b695da commit 72094c5f88d7dd5e4a2853d0ffbf4c23da8f413d
Showing with 21 additions and 30 deletions.
  1. +7 −8 admin.php
  2. +9 −0 admin/batch_manager_global.php
  3. +0 −22 admin/intro.php
  4. +5 −0 admin/site_update.php
@@ -238,15 +238,14 @@
}
// any photos with no md5sum ?
$nb_no_md5sum = count(get_photos_no_md5sum());
if ($nb_no_md5sum > 0)
if (in_array($page['page'], array('site_update', 'batch_manager')))
{
$template->assign(
array(
'NB_NO_MD5SUM' => $nb_no_md5sum,
'U_NO_MD5SUM' => $link_start.'batch_manager&filter=prefilter-no_sync_md5sum',
)
);
$nb_no_md5sum = count(get_photos_no_md5sum());
if ($nb_no_md5sum > 0)
{
$page['no_md5sum_number'] = $nb_no_md5sum;
}
}
// any orphan photo?
@@ -470,6 +470,15 @@
)
);
if (isset($page['no_md5sum_number']))
{
$template->assign(
array(
'NB_NO_MD5SUM' => $page['no_md5sum_number'],
)
);
}
// +-----------------------------------------------------------------------+
// | caddie options |
// +-----------------------------------------------------------------------+
@@ -44,28 +44,6 @@
// | actions |
// +-----------------------------------------------------------------------+
//check if images have no md5sum in database
$query = '
SELECT COUNT(*)
FROM '.CATEGORIES_TABLE.'
WHERE dir IS NOT NULL
;';
list($counter) = pwg_db_fetch_row(pwg_query($query));
if ($counter > 0)
{
$query = '
SELECT COUNT(*)
FROM '.IMAGES_TABLE.'
WHERE storage_category_id IS NOT NULL
AND md5sum IS NULL
;';
list($counter) = pwg_db_fetch_row(pwg_query($query));
if ($counter > 0)
{
$page['warnings'][] = '<a href="admin.php?page=batch_manager&amp;filter=prefilter-no_sync_md5sum">'.l10n('Some checksums are missing.').'<i class="icon-right"></i></a>';
}
}
if (isset($page['nb_pending_comments']))
{
$message = l10n('User comments').' <i class="icon-chat"></i> ';
@@ -67,6 +67,11 @@
$site_reader = new LocalSiteReader($site_url);
}
if (isset($page['no_md5sum_number']))
{
$page['messages'][] = '<a href="admin.php?page=batch_manager&amp;filter=prefilter-no_sync_md5sum">'.l10n('Some checksums are missing.').'<i class="icon-right"></i></a>';
}
// +-----------------------------------------------------------------------+
// | Quick sync |
// +-----------------------------------------------------------------------+

0 comments on commit 72094c5

Please sign in to comment.
You can’t perform that action at this time.