Problem/Motivation
Salesforce pull queue generates this error:
Error: Call to a member function size() on null en Drupal\salesforce_pull\QueueHandler->getUpdatedRecordsForMapping()
Steps to reproduce
Cron execution
Proposed resolution
Current code is:
public function getUpdatedRecordsForMapping(SalesforceMappingInterface $mapping, $force_pull = FALSE, $start = 0, $stop = 0) {
...
$results = $this->doSfoQuery($mapping, [], $start, $stop);
if ($results) {
$this->enqueueAllResults($mapping, $results, $force_pull);
}
return $results->size();
}
But "doSfoQuery" may return "\Drupal\salesforce\SelectQueryResult|null" when "SalesforceQueryEvent" fails, so options are:
- Log internal error that makes query event to fail instead of that one if that is intentional
- Take that possibility into account & avoid calling to "$results->size()" when that occurs and return FALSE
For now unless the first is justified, the second one will be preferred.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3458989-2.patch | 590 bytes | crzdev |
Comments
Comment #2
crzdev commentedAdding fix, please review and/or comment any suggestion, thanks in advance!
Comment #3
knyshuk.vova commentedI had the same error. Thanks for the patch. +1 RTBC
Comment #6
aaronbaumanCommitted, thanks for the patch.
Will be included in 5.1.1 and 5.0.6
Comment #7
crzdev commentedGreat, thanks!, Please ensure issue credits