Fix provider bailing if the indexable service filters an entire batch of objects
This commit is contained in:
parent
5cbb8ce1b6
commit
c97f0f1ddf
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue