#101 - Do not activate custom-search classes on all page-views
Overview: Civi 5.41 began migrating the "Custom Search" layer to an extension (legacycustomsearches
). dataprocessor
uses the "Custom Search" layer in an unusual way - which provokes a hard/ubiquitous error during upgrade. This revision makes it more robust against upgrade crashes.
Before: hook_config
unconditionally (on all page-views) loads CRM_DataprocessorSearch_Form_Search_Custom_DataprocessorSmartGroupIntegration
and calls
redirectCustomSearchToDataProcessorSearch($currentUrl)
.
After: hook_config
only calls CRM_DataprocessorSearch_Form_Search_Custom_DataprocessorSmartGroupIntegration
if it's needed.
Comments:
- The error arises from when autoloading the base-class
CRM_Contact_Form_Search_Custom_Base
. This class exists, but it won't be available until the upgrade is complete. - Strictly speaking, the two conditionals (on
$currentUrl
andssID
) are sufficient. I threw in a third conditional (class_exists()
) as an extra bit of paranoia. - I did a light
r-run
to ensure that the upgrade process works with the patch. However, I did not test the redirect. - We're planning to include a short-term work-around in 5.41.1. However, this work-around will go away soon (eg 5.42 or 5.43).