Fix provider bailing if the indexable service filters an entire batch of objects

This commit is contained in:
Tim Nagel 2014-06-19 11:14:13 +10:00
parent 5cbb8ce1b6
commit c97f0f1ddf
2 changed files with 10 additions and 0 deletions

View file

@ -64,6 +64,11 @@ abstract class AbstractProvider extends BaseAbstractProvider
$stepNbObjects = count($objects);
}
$objects = array_filter($objects, array($this, 'isObjectIndexable'));
if (!$objects) {
$loggerClosure('<info>Entire batch was filtered away, skipping...</info>');
continue;
}
if (!$ignoreErrors) {
$this->objectPersister->insertMany($objects);

View file

@ -36,6 +36,11 @@ class Provider extends AbstractProvider
$stepNbObjects = count($objects);
}
$objects = array_filter($objects, array($this, 'isObjectIndexable'));
if (!$objects) {
$loggerClosure('<info>Entire batch was filtered away, skipping...</info>');
continue;
}
$this->objectPersister->insertMany($objects);