API explorer fatal joining to contribution from contact
$contacts = civicrm_api4('Contact', 'get', [
'where' => [
['contributions.id', '=', 5],
],
'limit' => 25,
]);
The above generated from the api explorer gives a fatal error
Annoyingly the debug doesn't work when there is a mysql syntax error but the bug is in the join
SELECT a.id as id
, a.display_name as display_name
, a.preferred_language as preferred_language
FROM civicrm_contact a LEFT JOIN civicrm_email
emails
ON a.id = emails.contact_id LEFT JOIN civicrm_contribution
contributions
ON a.id = contributions.contribution_contact_id WHERE (contributions
.id
= "6940") AND (emails
.is_primary
= "") AND (a
.is_deleted
= "0") LIMIT 25 OFFSET 0 [nativecode=1054 ** Unknown column 'contributions.contribution_contact_id' in 'on clause']
@colemanw FYI