aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
Diffstat (limited to 'admin/include')
-rw-r--r--admin/include/functions.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index b0d0c4325..881a87e5b 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -262,6 +262,20 @@ DELETE FROM '.IMAGES_TABLE.'
;';
pwg_query($query);
+ // are the photo used as category representant?
+ $query = '
+SELECT
+ id
+ FROM '.CATEGORIES_TABLE.'
+ WHERE representative_picture_id IN (
+'.wordwrap(implode(', ', $ids), 80, "\n").')
+;';
+ $category_ids = array_from_query($query, 'id');
+ if (count($category_ids) > 0)
+ {
+ update_category($category_ids);
+ }
+
trigger_action('delete_elements', $ids);
}