Skip Navigation

[Resolved] Select dropdown only showing one option rather than all options.

This support ticket is created 4 years, 4 months ago. 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 9 replies, has 2 voices.

Last updated by Luo Yang 4 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#1775165

I am trying to:
I have created a custom search to search 30,000 custom post entries which I imported to WordPress. I'm searching using free text fields which seem to be working fine. However, the select dropdown for "Country" is just showing 1 country as opposed to the 8 or 9 that it should be showing. Also, the "Location" field does not have all the locations. Other Countries that should be appearing are Denmark, United Kingdom, Germany, Romania and India for example. Currently it's only showing Ireland.

The "Search Location" free text field is finding the countries and locations OK. However, the dropdowns are an issue as they're not displaying all options.

Link to a page where the issue can be seen: hidden link

I expected to see: All the Countries that have been imported via the 30,000 posts in the Countries dropdown. Also, all of the Locations should be in the Locations dropdown.

Instead, I got: Only one country is there and only some of the Locations.

I can try to provide the Duplictor files if you need at a later stage.

#1775243
custom-search.JPG

Hello,

I have done below modifications in your website:
Edit the content template "Employee Register":
hidden link
Find and select "view" block, in section "Custom Search", disable option "Show only filter options that would produce results", see my screenshot.

Please test again, check if the problem is fixed, thanks

#1775533

Hi Luo,

Thank you for the quick response and for looking at this. I have some additional questions.

(1) I see that all the countries and locations are there now. However, I previously had it working so that if you select Ireland, then only the Ireland locations would appear. Now when I select a country, the locations do not change and all of them will appear. Note that I'm on my mobile device at the moment.

How can I make the list of locations change depending on what country you select?

(2) Also, in the database, some countries will not have a location, which is fine. How can I make the location field disappear in the grid results blocks when a country does not have a location? I understand that this might require custom java script, which I can look at. However, where do I put this java script?

(3) Finally, the "Sectors Covered" line in the grid results has the dynamic data displaying below the "Sectors Covered" title. How can I keep the data on the same line, like the other data (Employee Name, License Number, etc...) ?

Thank you

#1775597

We can handle the questions one by one:
Q1) How can I make the list of locations change depending on what country you select?
You need to enable the option "Show only filter options that would produce results", I have tried it in your website, the original problem still persists, and the problem is abnormal, please try these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again

2) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

3) If the problem still persists, please provide database dump file(ZIP file) of your website, you can put the package files in your own google drive disk, share the link only, also point out the problem page URL and view URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

Q2) You can try [wpv-conditonal] shortcode, for example:

[wpv-conditional if="( $(wpcf-county-of-residence) ne '' )"]
The post has county-of-residence field value
[/wpv-conditional]

Q3) It seems to be a CSS issue, I have searched keyword "Sectors Covered" in the URL you mentioned above:
hidden link
But don't find any result, where and how can I see the "Sectors Covered"?
How do you want it to be displayed data on the same line? Can you take a screenshot for it?

#1776263

Hi Luo,

Thank you for the response.

I will do this over the next day or two and come back to you. Quite busy in work at the moment, but will try and come back asap.

Thanks

#1776525

Hi Luo,

Can you make my next response private please? I will be sharing a link.

Thanks

#1776549

Hi Luo,

In response to your last message:

(Q1)
1) I deactivated all plugins except the two Toolset plugins. I also change the the Twenty theme, but there was no change with the issue unfortunately. I also removed any custom Javascript. See screenshot (screenshot-of-Twenty-theme.png) in the "Screenshots" folder which on the server (discussed below). Unfortunately this did now help.

2) I tried some debugging and I have provided you with PHP logs that my hosting company gave to me. In relation to the other logging that you recommended.
- PHP Debugging: I added the code to the wp-config file. However, it doesn't seem to have created an error_log.txt file on the server. I chatted to my hosting company and they said that the error file is created only when there is an error.
- Javascript Debugging: I could not find any errors in the Console in Chrome Developer Tools.
- The Views debug tool: I enabled this but did not see any pop ups in either Chrome or Firefox. I disabled the popups via settings
- Alternative debugging method: I did not try this
- Advanced Debug Information: I did not try this

3) Unfortunately the problem is still persisting. Therefore, as you suggested, I actually uploaded the files via SFTP to the server and you should be able to download them from there. I provided you with SFTP details previously. The folder name is "Files-for-Toolset". Also, please note that the Duplicator plugin does not work with my host. Therefore I used "All-in-One WP Migration" to export the files and database. I saw in another support chat on here that someone else had similar issue with Duplicator and your colleague recommended All-in-One WP Migration. If you have any issues accessing this please let me know. There are 3 other folders there also.

(Q2) I will try this later once we get the main issue above resolved. Thanks for the suggestion.

(Q3) Apologies, it was "Sectors" a rather than "Sectors Covered". I added a screenshot to the server (sectors.JPG). I would like it to appear on the same line like the other single entry fields.

I really appreciate your help looking at this. If you have any questions please let me know.

Thanks

#1776553

I have enabled the private message again, please provide database dump file(ZIP file) of your website, you can put the package files in your own google drive disk, share the link only

#1776745
#1776905

Thanks for the details, I am downloading the files, will update here if find anything

#1776961

I have tried your database dump file in my localhost with a fresh WP installation + the latest version of Toolset plugins, it works fine after I enable the option "Show only filter options that would produce results", see my capture video:
hidden link

So there should be some PHP errors in your website, I suggest you check it with your webserver provider to get the PHP errors, WP will always produce some PHP notice/warning/error in the PHP log files.

And since you are using 30000+ custom posts, so it might be a server performance problem when enable the option "Show only filter options that would produce results", you need to increase the PHP memory limitation by following WP document:
https://wordpress.org/support/article/editing-wp-config-php/#increasing-memory-allocated-to-php

In my localhost, I am using below settings:

define('WP_MEMORY_LIMIT', '1024M');
define('WP_MAX_MEMORY_LIMIT', '2048M');