diff options
author | Silvio <s1lv10@uol.com.br> | 2010-03-23 16:13:47 -0300 |
---|---|---|
committer | Silvio <s1lv10@uol.com.br> | 2010-03-23 16:13:47 -0300 |
commit | 74c958582f4e4545852005124e9b33b1b5cc3438 (patch) | |
tree | 741f165ff80e5445eea77854d07c6c86e061ae4d | |
parent | abbd5da4f71ca17b9adaa94ad32d796e6b77369b (diff) | |
download | mass_image_import-74c958582f4e4545852005124e9b33b1b5cc3438.tar.gz mass_image_import-74c958582f4e4545852005124e9b33b1b5cc3438.tar.bz2 |
Bugfixes
-rw-r--r-- | .mass_image_import.module.swp | bin | 20480 -> 20480 bytes | |||
-rw-r--r-- | 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 Binary files differindex bb8029b..0e6b38e 100644 --- a/.mass_image_import.module.swp +++ b/.mass_image_import.module.swp 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); } |