Fatal error when sorting on a custom field in a profile listing
Follow on from #1269 (comment 24297) and #1269 (comment 24382) I'm able to reproduce the following on dmaster.demo and also a recent PR test site, but my local master seems ok, but since it's been reported on stackexchange and seems a problem on two official builds I'm ignoring my local install.
To reproduce:
- Create a profile used for listings.
- Include a custom field, e.g. the stock "Marital Status" one.
- Use the profile in listings mode.
- Try to sort by the custom field.
Error: Class name must be a valid object or a string in CRM_Contact_BAO_Query->prepareOrderBy() (line 6422 of .../CRM/Contact/BAO/Query.php).
It seems like the same thing as #1269 (closed), where fieldspec bao isn't defined for custom fields. I'll put up a PR that does the same thing as that ticket, just that because there seems to be something weird (or not weird) on my install I'm just guessing if it works.