Eliminate unused query on CRM_Core_BAO_CustomQuery::_construct
Whenever BAO_Query::apiQuery is called (e.g v3 Contact.get) & there is a custom field involved a deprecated property $_options is populated -requiring an extra query
Out of the 3 core places where CRM_Core_BAO_CustomQuery( appears 2 never use _options. The 3 non-core places include advanced-events by @mattwire which does refer to it & another extension that doesn't.
The last is in apiQuery - which does not use it, but returns it.
Most places that call apiQuery do not use the value - still going through these - the one exception is getTokenDetails - which passes it back to functions which never seem to use it.
I'm doing a bit more cleanup to prepare - but I think it can go
Edited by eileen