From 74c958582f4e4545852005124e9b33b1b5cc3438 Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 23 Mar 2010 16:13:47 -0300 Subject: Bugfixes --- .mass_image_import.module.swp | Bin 20480 -> 20480 bytes mass_image_import.module | 9 +++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.mass_image_import.module.swp b/.mass_image_import.module.swp index bb8029b..0e6b38e 100644 Binary files a/.mass_image_import.module.swp and b/.mass_image_import.module.swp differ diff --git a/mass_image_import.module b/mass_image_import.module index 411217b..322d66e 100644 --- a/mass_image_import.module +++ b/mass_image_import.module @@ -80,7 +80,7 @@ function mass_image_import_batch(&$context) { $limit = variable_get('image_import_page_size', 50); for ($n = 0; $n <= $limit; $n++) { - if ($context['sandbox']['progress']++ > $context['sandbox']['max']) { + if ($context['sandbox']['progress'] >= $context['sandbox']['max']) { $context['finished'] = 1; break; } @@ -94,6 +94,7 @@ function mass_image_import_batch(&$context) { )); mass_image_import_file($image); + $context['sandbox']['progress']++; } } @@ -182,12 +183,16 @@ function mass_image_import_file($file) { */ function mass_image_import_batch_finished($success, $results, $operations) { if ($success) { - if ($results > 0) { + if (count($results) > 0) { $message = format_plural(count($results), t('One processed.'), t('@count processed.')); } + else { + $message = t('No images to import.'); + } } else { $message = t('Finished with an error.'); } + drupal_set_message($message); } -- cgit v1.2.3