impossible to change search_results during handling of event "qsearch_results" #1475

Closed
opened 2026-10-05 00:45:23 +02:00 by adam · 2 comments
Owner

I'm currently trying to extend quicksearch to search contents of private fields. For this i use the eventHandler
"qsearch_results" wich allows me to add the so found items to $search_results['items'].
This works, as long as there is no match on the core fields. If there is such a match, then the content of $search_results['items'] wil be overwritten by later code during permission checks.
IMO the handler for qsearch_results should receive a copy of the $ids array, an return a new $ids array (changed or not)
$ids = trigger_change('qsearch_results', $ids, $expression, $qsr);

I'm currently trying to extend quicksearch to search contents of private fields. For this i use the eventHandler "qsearch_results" wich allows me to add the so found items to $search_results['items']. This works, as long as there is no match on the core fields. If there is such a match, then the content of $search_results['items'] wil be overwritten by later code during permission checks. IMO the handler for qsearch_results should receive a copy of the $ids array, an return a new $ids array (changed or not) $ids = trigger_change('qsearch_results', $ids, $expression, $qsr); <!-- github-sync-id:1300328423 -->
adam closed this issue 2026-10-05 00:45:23 +02:00
Author
Owner

Hi @tkempf

That sound good. Can you make a pull-request?

Hi @tkempf That sound good. Can you make a pull-request? <!-- github-comment-id:1180085147 -->
Author
Owner

ok done PR #1688 is online

ok done PR #1688 is online <!-- github-comment-id:1180120681 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1475