Skip Navigation

[Resuelto] Custom search no longer working (update on previously resolved post)

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem: My custom search filters appear to be broken. The filters do not seem to be applied to the search results.

Solution: Check the settings for your filters to ensure that the search terms are set correctly. Delete, then recreate any filters that seem to be broken.

This support ticket is created hace 6 años, 11 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 7 respuestas, has 2 mensajes.

Last updated by Craig hace 6 años, 11 meses.

Assisted by: Christian Cox.

Autor
Mensajes
#521662

I previously had help from Ana regarding setting up a search from a drop down menu which was working perfectly. My client has just informed me that the search facility (select menu) does not return any results for the housing officers, and returns all maintenance surveyors instead of only the correct ones.

https://toolset.com/forums/topic/display-selected-checkboxes-based-on-search-result/#post-226590

The pages with the search facility are:-
hidden link
and
hidden link

I haven't made any changes to the Views or Code, so it may have been a Types or Views update which has caused the issue.

I would really appreciate it if someone could take a look and see if there was something obvious causing the issue.

Kind regards,
Craig

#521703

Hi, I'll be glad to take a look. Can you perform these troubleshooting steps and let me know the results?
- Check to be sure the custom function Ana provided before is registered as described in the following document:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-custom-functions-in-conditions/
- Temporarily disable all plugins except Types and Views. Temporarily enable a default theme like Twenty Seventeen. Try to search for officers and surveyors again. Is the problem resolved?
- Backup your site, then update to the latest version of WordPress. Is the problem resolved?

If none of these options resolves your problem, I'll need to do some deeper investigation. I would like to see if your WordPress installation is registering any errors. You can see how to enable debug logging here:
https://toolset.com/documentation/user-guides/debugging-toolset/

Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

define('WP_DEBUG', true);

Then add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
ini_set('display_errors', 'Off');

Then, search for surveyors or officers again. If any errors are generated, this will create an error_log.txt file in your site's root directory. Please send me its contents. Once that is done, you can revert the updates you made to wp-config.php.

#521742

Hi Christian,

I have tried everything you have asked and the search still didn't work, and unfortunately no error file was generated. Although I am getting debug info on the hidden link page.

This is a copy of the live site and I would be more than happy to provide access to the admin if you would like to take a look for yourself.

Kind regards,
Craig

#521758

Okay thanks, please provide the login credentials in private reply fields here and I will take a look.

#521792

Hi I didn't quite finish this today but I did make some progress. I made a clone of your site using Duplicator so I could test and easily revert things locally. For the Maintenance Surveyors views, I was able to get these working better by adjusting the filters for each View. It appears that the "choose-by-area-maintenance" filter wasn't working correctly, so I deleted it from both the Query Filter and Filter Control areas. Then I recreated the Filter Control using the URL parameter like before, and now I'm seeing the results I would expect to see. I'll try the other View early tomorrow and give you an update then. Thanks for your patience!

#521900

Hi Christian,

That is great news. Thank you so much for your help. I look forward to hearing back from you later on today.

Kind regards,
Craig

#522206
officer-search-results.png
officer-view.png

Okay I believe I've got this working again on my local site. Here's what I did:
- Deleted, then recreated filter controls and query filters for "choose-by-area-maintenance" in both Maintenance Officers Views
- That's it for the Maintenance Officers Views, they should be working correctly at this point
- Deleted, then recreated the filter controls and query filters for "choose-by-area" in both Housing Officers Views.
- Edit the Housing Officer Results page. In each shortcode, change "Housing Officers" to "Housing Officer"

Housing Officer filter screenshots attached. Let me know how it goes.

#522446

Hi Christian,

Many, many thanks.

I went through your provided steps and can confirm that all is now working again. You are a star. Much appreciated.

I have a feeling that my client has been trying to resolve the issue on their own without any real knowledge of Types & Views, as I know for a fact that the Housing Officer Results Page shortcode was originally "Housing Officer". C’est la vie!

Kind regards,
Craig

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.