Posted: March 5, 2019 at 2:17 am
|
Good Morning, This issue we already formulated in another post and we gave it as solved: https://eventespresso.com/topic/add-new-filter-in-attendees-searcher/ but later we have noticed the following error. When we add the following filters in the search of records, the result is limited to a single match, not to all matches as it happens without the filters As you can see in the image, before adding the filters, the result of the search gives us three coincidences: http://salonescopia.salonesguiapenin.com/wp-content/uploads/2019/03/busquedasinfiltro.jpg After adding the filters, it only returns the first concidence and not the following ones. http://salonescopia.salonesguiapenin.com/wp-content/uploads/2019/03/busquedaconfiltro.jpg how can we solve this? Thank you The filter used is the one proposed by you: } function my_custom_search_field_reg( $where, $request ) { |
Hi, I don’t remember proposing that entire filter, just the last part with the transaction line items. Are you saying that the last part is causing the limited set, or is it the entire customization? I’m afraid I’m not able to replicate this, all expected results are returned with and without the filter on my test site. Maybe what you could do is try removing one condition at a time to see if that makes a difference. |
|
|
Thank you, Josh, you are right, you contributed the last part of the filter, the transaction, the rest we got from previous answers in the forum, but it is just when we add this last part to the filter when it fails. $ where [‘OR * search_conditions’] [‘Transaction.Line_Item.LIN_desc’] = array (‘LIKE’, $ search_string); With the two previous filters, one by one, or both at the same time, it works correctly and returns the five matches, adding the Transaction.Line_Item.LIN_desc filter combined with the Answer.ANS_value filter is when it only returns the first match. .. in this case, the term jordi appears only in the name and in the email … $ where [‘OR * search_conditions’] [‘Answer.ANS_value’] = array (‘LIKE’, $ search_string); |
In short, it’s because of the multiple joins used in the query. When you join using the line items it’s returning a single row. One way to try and prevent it is to set the GROUP BY statement on the query to I can request a filter is added to core that could be used to set the group by value but as it stands you’ll need to not run the above query using |
|
The support post ‘Error in adding filters when searching for records’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.