Contact Logging Detail report crashes when a contribution and contact are updated together
This is a regression, but it dates back to Civi 5.35, so I'm not going to target the RC.
Steps to replicate
- Turn on advanced logging.
- Record a donation through a contribution page for either a) a new contact, b) an existing contact, but adding/changing their name.
- Go to that contact's change log, and try to view the details of the most recent change (by clicking Update next to the change).
Expected result
You see the changes.
Actual result
DB Error: Syntax Error
.
This regression comes from PR 19504. Previously, not every DAO had a _labelField
property - so CRM_Logging_ReportDetail::convertForeignKeyValuesToLabels()
checking if the property existed was basically the same as checking if it was defined. Now it will always exist (in CRM_Core_DAO
) but not always be defined. So we change the conditional to reflect that.