SearchKit, Packaged Searches for disabled Core Extensions are left Active and cause Fatal Errors because the API they call is no longer available
SearchKit, Packaged Searches for disabled Core Extensions are left Active and cause Fatal Errors because the API they call is no longer available.
Steps to reproduce
To reproduce, where Contacts can no longer be viewed in the backend if the CiviMember extension is disabled, after being previously enabled.
- Using a CiviCRM site with CiviMember and SearchKit enabled.
- Check that the SearchKit, Search: Contact Summary Memberships exists.
- View a Contact, contact will load - no error.
- Disable the CiviMember extension.
- Clear CiviCRM cache.
- Again, view a Contact, contact will no longer load and the error is shown: API (Membership, get) does not exist (or the extension it belongs to is not enabled).
- View SearchKit, Search: Contact Summary Memberships exists. Has a For of "Missing".
- CiviCRM logs show fatal error: API (Membership, get) does not exist (or the extension it belongs to is not enabled) and \Civi\API\Exception\NotImplementedException
Expected behaviour
- The expected behaviour is that SearchKit Searches that use APIs which are not available, should be automatically disabled (ideal) or removed (less ideal).
- Provide a method in the SearchKit UI to bulk disable and/or remove SearchKit Searches.
Workaround
Re-enable CiviMember to restore CiviCRM to a workable state, advise users to ignore CiviMember functionality.
Agileware Ref: CIVICRM-2239