1

I just had a report that someone is having trouble seeing the list of exported batches (civicrm/financial/financialbatches?reset=1&batchStatus=5) and it seems to have started just recently -- likely after I upgraded to CiviCRM 5.6 (I also recently upgraded from PHP 7.0 to PHP 7.1 but I reverted that as a test and still had the error). The strange part is that there is no error in viewing the list of Open or Closed batches, just the Exported batches. There are a lot of exported batches -- could the volume of batches be an issue here?

The only error I've been able to track down is the popup error:

DataTables warning: table id=crm-batch-selector-5 - Ajax error. For more information about this error, please see http://datatables.net/tn/7

...and the one in the Drupal watchdog log:

Notice: Trying to get property of non-object in CRM_Batch_BAO_Batch::getBatchList() (line 335 of /path-to-site/sites/all/modules/civicrm/CRM/Batch/BAO/Batch.php).


  • Drupal 7
  • CiviCRM 5.6.0
  • PHP 7.1
2

Okay, solved. There was something awry with the latest Batch in that it had been exported, but the file didn't exist in the custom directory/filesystem. I changed that last batch status directly in the database from 5 (exported) to 2 (closed) and now the screens all load as usual.

I suppose line 335 of /path-to-site/sites/all/modules/civicrm/CRM/Batch/BAO/Batch.php is trying to load information about this non-existent file and causes the error somehow, but I don't fully understand how.

EDIT: The error recurred when we tried to re-export the problem batch, but I was able to get a more helpful error message this time:

Error: [] operator not supported for strings in CRM_Financial_BAO_ExportFormat_CSV->formatHeaders() (line 166 of /path-to-site/sites/all/modules/civicrm/CRM/Financial/BAO/ExportFormat/CSV.php).

So this is in fact a PHP 7.1 bug. Issue in lab is here. PR is here.

  • Above patch is merged & will be in the 5.8 release – user4278 Oct 18 '18 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.