Skip Navigation

[Resolved] Problems after updating toolset plugins to latest version

This thread is resolved. Here is a description of the problem and solution.

Problem: After updating Toolset plugins, one option in my custom search filter is automatically selected upon page load.

Solution: Add default_label=" " to the wpv-control-postmeta filter shortcodes for Area and Bathrooms, as shown below:

...
<label>[wpml-string context="wpv-views"]Area[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-region_v1" type="select" url_param="wpv-wpcf-region_v1" default_label=" "]
...
<label>[wpml-string context="wpv-views"]Bathrooms[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-no-of-bathrooms" type="select" url_param="wpv-wpcf-no-of-bathrooms" default_label=" "]
...

That should resolve the problem where one of the options is selected automatically.

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-control-postmeta

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
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 replies, has 2 voices.

Last updated by Christian Cox 4 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#2028529

Greetings,

We updated your plugins to the latest versions:

Views: from 2.5.2 to 3.5
Layouts: from 2.6.7 to 2.6.9
Types: from 2.3.5 to 3.4.8

and we encountered a few bugs.

Currently, the updates are installed on the staging site hidden link (bugs are present here) so you can compare to the live site hidden link (currently working fine-NOT updated).

The issues encountered can be seen in this page: hidden link
This page uses Views to load Project post types. However, since updating to the latest version, some things are broken:

1) The sidebar (sidebar is present on every page of the site) has a WP Views Filter widget so that the user can filter/search projects. On the live site, hidden link, as you can see there are blank values for the "Area" and "Bathrooms" fields (as it should be). However on the staging, updated site hidden link these fields are pre-filled with values making the search functionality broken.

2) The pagination at the bottom of the page hidden link has not only changed (compare with hidden link) but is also malfunctioning. If we press to go to the 2nd page, we get the message "No items matching your search criteria were found". This could be due to the first issue mentioned above as you can observe in the URL that the following parameters are being added "wpv-wpcf-region_v1=Athens+and+Suburbs&wpv-wpcf-no-of-bathrooms=1", which relate to the pre-filled values mentioned.

Are you able to please provide any insights as to why these are happening? Let us know if you require any additional information.

Best Regards,
Stavros

#2028691

Hello, we may need to make some adjustments in the View to add a default non-selected filter option for the Areas and Bathrooms filters. Can you edit this View on the staging site, copy and paste the information from the Search and Pagination editor panel here in your next reply? Specifically I need to see the shortcodes for the Areas and Bathrooms filters, but if you are not sure which shortcodes to copy and paste you can copy and paste the entire Search and Pagination editor panel contents. We may be able to adjust the code in those shortcodes to add a default unselected option, which should fix the issue where some filters are preselected on the page after updating plugins.

Please paste that information in your next reply. I will review the code and make some recommendations.

Thank you!

#2029323

Hello Christian,

Sure, here is the entire code from the Search and Pagination Panel:

[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="form-group">
<label>[wpml-string context="wpv-views"]Property Type[/wpml-string]</label>
[wpv-control-post-taxonomy taxonomy="project_category" type="select" url_param="wpv-project_category"]
</div>
<div class="form-group">
<label>[wpml-string context="wpv-views"]Area[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-region_v1" type="select" url_param="wpv-wpcf-region_v1"]
</div><div class="form-group">
<label>[wpml-string context="wpv-views"]Code[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-code" url_param="wpv-wpcf-code"]
</div>

<div class="form-group form-group-col1">
<label>[wpml-string context="wpv-views"]Bedrooms[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-no-of-bedrooms" type="select" default_label=" " url_param="wpv-wpcf-no-of-bedrooms"]
</div>

<div class="form-group form-group-col2">
<label>[wpml-string context="wpv-views"]Bathrooms[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-no-of-bathrooms" type="select" url_param="wpv-wpcf-no-of-bathrooms"]
</div>
<div class="form-group form-group-col1">
<label>[wpml-string context="wpv-views"]Min Price[/wpml-string]</label>
[wpv-control-postmeta display_values=",80 000€,120 000€,180 000€,250 000€,400 000€,600 000€" values=",80000,120000,180000,250000,400000,600000" field="wpcf-price_v1" type="select" source="custom" url_param="wpv-wpcf-price_v1_min"]
</div>

<div class="form-group form-group-col2">
<label>[wpml-string context="wpv-views"]Max Price[/wpml-string]</label>
[wpv-control-postmeta display_values=",80 000€,120 000€,180 000€,250 000€,400 000€,600 000€" values=",80000,120000,180000,250000,400000,600000" field="wpcf-price_v1" type="select" source="custom" url_param="wpv-wpcf-price_v1_max"]
</div>
[wpv-filter-submit name="Search" output="bootstrap" class="btn btn-primary btn-block btnPadding"]
[/wpv-filter-controls]
[wpv-filter-end]

I'm also including the Loop Editor Panel code, just in case:

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<ul class="wpv-loop js-wpv-loop" style="list-style: none;">
<wpv-loop>

  • [wpv-post-featured-image size="medium"]
    <div class="ibs-sr-text">
    <h2>[wpv-post-link]</h2>
    [wpv-post-excerpt length="260" more="..."]
    <p>Price: [types field='price_v1'][/types] €</p>
    </div>
    <div style="clear: both"></div>
  • </wpv-loop>

    [wpv-pager-nav-links output="bootstrap" first_last_links="true" previous_next_links="true" step="5" reach="2"]
    <!-- wpv-loop-end -->
    [/wpv-items-found]
    [wpv-no-items-found]
    [wpml-string context="wpv-views"]No items matching your search criteria were found[/wpml-string]
    [/wpv-no-items-found]
    [wpv-layout-end]

    Finally this code is from the Output Editor Panel (again, just in case):

    [wpv-filter-meta-html]
    [wpv-layout-meta-html]

    Again, please let me know if you require anything else.

    Best Regards,
    Stavros

    #2029665

    Please add default_label=" " to the wpv-control-postmeta filter shortcodes for Area and Bathrooms, as shown below:

    ...
    <label>[wpml-string context="wpv-views"]Area[/wpml-string]</label>
    [wpv-control-postmeta field="wpcf-region_v1" type="select" url_param="wpv-wpcf-region_v1" default_label=" "]
    ...
    <label>[wpml-string context="wpv-views"]Bathrooms[/wpml-string]</label>
    [wpv-control-postmeta field="wpcf-no-of-bathrooms" type="select" url_param="wpv-wpcf-no-of-bathrooms" default_label=" "]
    ...
    

    That should resolve the problem where one of the options is selected automatically. Let me know if you have trouble implementing this change and I'll be glad to take a closer look.

    #2030679

    Hello,

    Thank you for the code tweak, that seemed to help with the pagination issue showing "No items matching your search criteria were found", when we change pages.

    However, there are still issues present with the search filter. For example:

    Issue 1
    Staging:Let's say we type in the search widget on the right "715" in the "Code" field. Then we would get one result: "Dainty 2-bed cottage with approx. 5000m2 of land [715]". If we want to do another search from the same result page, say select an "Area", then we get only one value "Peloponnese - Lakonia" on the dropdown menu -> hidden link
    The same applies to the other dropdown fields. Meaning that even if we delete the 715 value we are "limited" with the other fields' values to whatever values are present in the dropdowns. I think these values are the ones that the 715 result (so the current result in our example) has for it's search criteria fields -> hidden link

    Live: The above issue doesn't occur as all available values from the dropboxes are present regardless of search results -> hidden link

    I hope I explained this as best as possible, hopefully the screenshots will be of valuable help.

    Issue 2
    The pagination looks a bit weird compared to the live site. Please compare below screenshots:

    Staging (hidden link): hidden link
    Live (hidden link): hidden link

    Looks like a styling/CSS issue? Is the updated version of Views using different styles, especially on the <a> elements of the pagination, than the old one?

    Best Regards,
    Stavros

    #2032331
    custom-search-settings.png

    Issue 1...The above issue doesn't occur as all available values from the dropboxes are present regardless of search results
    This might be resolvable with a change to some View configurations. One of the configurations available for Views in Custom Search Settings allows you to choose between "Always show all values for inputs" and "Show only available options for each input". You should choose the first option "Always show all values for inputs". You may need to select "Let me choose individual settings manually" to expose this setting in the Custom Search Settings paenl. See custom-search-settings.png for a visual representation of those selections.

    Issue 2...The pagination looks a bit weird compared to the live site.
    This seems to be related to a difference in the Bootstrap library versions included on the two sites. I'm not sure offhand which version of Bootstrap is being loaded on the live site, but I can tell the staging site is loading a more recent version than the live site. You could try loading an older version of Bootstrap on the staging site to see if it's more compatible. Versions 3 and 4 are now available for inclusion in Toolset > Settings, in the General tab. I would try loading version 3 first to see if the outcome is more compatible with the existing styles of your site. If not, you can try disabling Bootstrap classes in this navigation element by removing output="bootstrap" from the shortcode as follows:

    [wpv-pager-nav-links first_last_links="true" previous_next_links="true" step="5" reach="2"]
    

    Since the previous Toolset versions you had installed, we have found there are some general compatibility issues between Divi and Bootstrap. For new sites using the Divi theme, we typically recommend disabling the Bootstrap library to prevent those compatibility issues. Disabling Bootstrap will have some negative impacts on Toolset, though, as some features rely on Bootstrap for grid-based positioning and other functionality, so the previous recommendation about disabling Bootstrap just for this navigation element is probably less destructive in general.

    If none of these options really solves the problem, we can split off a separate ticket to discuss in more detail. Our policy is one issue per ticket, so I would like to focus on the filtering problem here in this ticket and look into the pagination display problem in the new ticket. Let me know if you'd like to split off another ticket and I can take care of that automatically.

    #2034119

    Hello again and apologies for the late reply.

    Issue 1:
    I followed your instructions with the screenshot included and that solved the issue! Thank you!

    Issue 2:
    No need to open a new ticket as I managed to achieve the same result as the live site by using CSS.

    We already used your helpful solutions to update the live site fully (which seems to work fine now) and so, I think we can mark this ticket as resolved, if that is ok with you.

    Thank you again for your help!

    Best Regards,
    Stavros

    #2034121

    That's great, I'm happy to mark this one resolved and close out here.