From e997b889f3bfa1ffbc5157e8148ad86ca5430689 Mon Sep 17 00:00:00 2001 From: dakku Date: Thu, 7 Apr 2016 00:41:04 +0100 Subject: [PATCH] issue 2701407 --- inc/photos.edit.inc | 6 ++++-- photos.module | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/inc/photos.edit.inc b/inc/photos.edit.inc index ebcfada..43ec0e1 100644 --- a/inc/photos.edit.inc +++ b/inc/photos.edit.inc @@ -199,7 +199,7 @@ function photos_upload_form_submit($form, &$form_state) { else { file_delete($file->uri); watchdog('photos_swfu', 'Wrong file type'); - } + } } else { watchdog('photos_swfu', 'Upload error. Could not move temp file.'); @@ -942,7 +942,9 @@ function photos_editlist_submit($form, &$form_state) { } if (isset($pid) && count($pid)) { foreach ($pid as $nid) { - _comment_update_node_statistics($nid); + if (module_exists('comment')) { + _comment_update_node_statistics($nid); + } photos_set_count('node_album', $nid); } $uid = array_unique($uids); diff --git a/photos.module b/photos.module index 2e68a1c..e9c0fa1 100644 --- a/photos.module +++ b/photos.module @@ -1523,7 +1523,10 @@ function photos_file_del($fid, $filepath = 0, $count = 0) { photos_set_count('node_node', $file->pid); photos_set_count('node_album', $file->pid); photos_set_count('user_image', $file->uid); - _comment_update_node_statistics($file->pid); + + if (module_exists('comment')) { + _comment_update_node_statistics($file->pid); + } } if (empty($file)) { -- 1.8.4.2