Error: Call to a member function size() on null en Drupal\salesforce_pull\QueueHandler->getUpdatedRecordsForMapping()

Created on 4 July 2024, 2 months ago
Updated 31 July 2024, about 1 month ago

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:

  1. Log internal error that makes query event to fail instead of that one if that is intentional
  2. 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.

πŸ› Bug report
Status

Fixed

Version

5.0

Component

salesforce_pull.module

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024