Replace hard-coded call to legacyCustomSearch framework with a hook
We should get the legacy custom search frame work out of our GroupContactCache
BAO and eventually out of core code (and unhide the extension, with a view to not shipping enabled).
In order to do this I think we need a hook to get the sql when loading a contact group
It might potentially wind up like this
I see there is handling for the sql being empty - which seems weird - but we could probably assume that if anything ever needs no sql it is not a custom search
Note that CRM_Contact_BAO_SearchCustom
could be moved to the extension with the hook once as part of this as nothing else calls it
The other place where the legacy custom search framework returns sql is
Internally the first query calls the same contactIDs