aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.mass_image_import.module.swpbin20480 -> 20480 bytes
-rw-r--r--mass_image_import.module9
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
--- a/.mass_image_import.module.swp
+++ b/.mass_image_import.module.swp
Binary files 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);
}