I have imported (tens of) thousands of historic contributions to a site that uses Accounting Batches regularly. They were starting to bog down the batch assignment page so I thought I would simply create an administrative batch, drop them in via SQL directly as follows, and then be done with them.
insert into `civicrm_entity_batch` (entity_table,entity_id,batch_id) select 'civicrm_financial_trxn',trxn.`id`,188 from `civicrm_financial_trxn` trxn where trxn.`trxn_id` LIKE 'archive_%';
In the SQL above, I am inserting the string 'civicrm_financial_trxn' into the
entity_table field, the id, and then the number 188 (which is the ID of the new batch I created). Also, all the transaction IDs for these archival records have been prepended with 'archive_' (hence the
where clause above to choose just these contributions).
This works for the most part (the transactions show up in the batch, and I can close it as I would expect), but there is a kicker. Now in any new batches, the bottom portion of the page where you typically assign transactions to the batch never stops "Processing":
The Drupal watchdog has a few notices:
Strict warning: Non-static method CRM_Batch_BAO_Batch::links() should not be called statically in CRM_Batch_BAO_Batch::links() (line 280 of /var/www/public_html/sites/all/modules/civicrm/CRM/Batch/BAO/Batch.php).
Notice: Undefined index: batch_type in CRM_Batch_BAO_Batch::getBatchListSelector() (line 230 of /var/www/public_html/sites/all/modules/civicrm/CRM/Batch/BAO/Batch.php).
Does anyone have an idea what this might mean? The archival imports were not intended to be fully integrated into the Financial/Accounting portion (they were batched and dealt with in a previous system) but were meant simply as informational background on contacts.
How can I troubleshoot/fix this?