When we use Find Contributions to generate a list of contributions for thank you e-mails, then select the All Records radio button, and then choose Thank You Letters, we see the fatal error below.
I do see code in CRM/Contribute/Form/Task/Batch.php that looks like it's meant to handle an issue like this: https://github.com/civicrm/civicrm-core/blob/67ea385e0e5cd3daed04807c1465605f059b1002/CRM/Contribute/Form/Task/Batch.php#L230
We do not get the fatal error when we use the select all checkbox instead of the All Records radio button.
I have not yet been able to replicate on the demo. (The CiviHosting Drupal 7 demo is throwing an error right now itself.)
$Fatal Error Details = Array (
[callback] => Array ( [0] => CRM_Core_Error [1] => handle )
[code] => -19 [message] => DB Error: no such field [mode] => 16
[debug_info] =>
SELECT civicrm_contribution.id, contact_a.id as contact_id,
civicrm_contribution.id as contribution_id,
civicrm_contribution.contribution_status_id as `contribution_status_id`
FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON
civicrm_contribution.contact_id = contact_a.id WHERE ( (
civicrm_contribution.receive_date >= '20161017000000' ) AND (
civicrm_contribution.receive_date <= '20161018235959' ) AND
civicrm_contribution.financial_type_id IN ("5", "1", "4") AND
civicrm_contribution.financial_type_id IN ("1") AND
civicrm_contribution.contribution_status_id IN ("1") AND
civicrm_contribution.thankyou_date IS NULL AND
civicrm_contribution.is_test = 0 ) AND
(contact_a.is_deleted = 0)
GROUP BY civicrm_contribution.id
ORDER BY `contribution_source` desc,
`contact_a`.`id` [
nativecode=1054 ** Unknown column 'contribution_source' in 'order clause']
[type] => DB_Error
[user_info] =>
SELECT civicrm_contribution.id, contact_a.id as contact_id,
civicrm_contribution.id as contribution_id,
civicrm_contribution.contribution_status_id as `contribution_status_id`
FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON
civicrm_contribution.contact_id = contact_a.id WHERE ( (
civicrm_contribution.receive_date >= '20161017000000' ) AND (
civicrm_contribution.receive_date <= '20161018235959' ) AND
civicrm_contribution.financial_type_id IN ("5", "1", "4") AND
civicrm_contribution.financial_type_id IN ("1") AND
civicrm_contribution.contribution_status_id IN ("1") AND
civicrm_contribution.thankyou_date IS NULL AND
civicrm_contribution.is_test = 0 ) AND
(contact_a.is_deleted = 0)
GROUP BY civicrm_contribution.id
ORDER BY `contribution_source` desc,
`contact_a`.`id`
[nativecode=1054 ** Unknown column 'contribution_source' in 'order clause'] [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT civicrm_contribution.id, contact_a.id as contact_id, civicrm_contribution.id as contribution_id, civicrm_contribution.contribution_status_id as `contribution_status_id` FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( ( civicrm_contribution.receive_date >= '20161017000000' ) AND ( civicrm_contribution.receive_date <= '20161018235959' ) AND civicrm_contribution.financial_type_id IN ("5", "1", "4") AND civicrm_contribution.financial_type_id IN ("1") AND civicrm_contribution.contribution_status_id IN ("1") AND civicrm_contribution.thankyou_date IS NULL AND civicrm_contribution.is_test = 0 ) AND (contact_a.is_deleted = 0) GROUP BY civicrm_contribution.id ORDER BY `contribution_source` desc, `contact_a`.`id` [nativecode=1054 ** Unknown column 'contribution_source' in 'order clause']"] )