Getting error when using custom searches
Overview
When using a custom search (including most of the ones shipped with core but also ones in extensions) I can not select a single row and get this error:
User deprecated function: Deprecated function CRM_Contact_Selector::fillupPrevNextCache,
use Custom searches should return sql capable of filling the prevnext cache..
in CRM_Core_Error::deprecatedFunctionWarning()
(regel 1044 van /var/www/html/speeltuin/sites/all/modules/civicrm/CRM/Core/Error.php).
Investigation shows that the error originates from the fillWithSql
function in CRM_Core_PrevNextCache_Sql
. This does not work in combination with the count()
function in most custom searches. This means the next prev cache is not filled nor does the select option work.
Tested with 5.41.1 and replicated on dmaster.
Reproduction steps
- Click on Search>Custom Searches and select Zip Code Range from the list
- Select 1 as from and 9999 to search for the range
Current behaviour
- This error is one in the list of errors:
User deprecated function: Deprecated function CRM_Contact_Selector::fillupPrevNextCache,
use Custom searches should return sql capable of filling the prevnext cache..
in CRM_Core_Error::deprecatedFunctionWarning()
(line 1043 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/Error.php).
- Try to select a single line, only selecting all rows will work
Expected behaviour
I should be able to select a single row or a couple of rows and perform actions on the selected ones
Environment information
- Browser: _Firefox 95.0 (Linux Mint)
- CiviCRM: _Master/5.41.1
- PHP: 7.3_
- CMS: Drupal 7.81
- Database: _MySQL 5.7.7
- Web Server: _Apache 2.4
Comments
Although custom searches are slowly being faded out this error breaks existing functionality so I think it is a regression? I think it certainly makes sense to remove the custom searches from future versions and encourage the usage of SearchKit. There are however quite a few extensions out there that use Custom Searches, and the Developer Guide still explains the civix generate:search. So I think this should be fixed AND the Developer Guide should be updated with instructions how we actually now want the PrevNext filled and used? Happy to update the Developer Guide if someone can explain me what is required for the PrevNext new style?