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
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.
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
Okay thanks, please provide the login credentials in private reply fields here and I will take a look.
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!
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
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.
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