Skip Navigation

[Resuelto] Updating Types 3.3.10 to 3.3.12 breaks functionality on my website

This support ticket is created hace 3 años, 7 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
- 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/Karachi (GMT+05:00)

This topic contains 14 respuestas, has 3 mensajes.

Last updated by Craig hace 3 años, 7 meses.

Assisted by: Waqar.

Autor
Mensajes
#1733443

I have a page where I am using a Select menu to populate a View. The View is filtered using a URL PARAM which changes based on the item selected in the Select menu. This worked up until Types 3.3.10, but both 3.3.11 and 3.3.12 both break the functionality.
On page load, all Staff Members are shown, but when a Town is selected from the Select menu only the Staff Members from that Town should be shown. There are also 2 static Staff members who appear on every page (below the dynamically loaded Staff Members).

Link to a page where the issue can be seen:
hidden link (Types 3.3.12 – ignore the missing images on this page)

The live site – hidden link shows it all working as it should (Types 3.3.10)

I expected to see:
Only the Staff Members from the selected town (plus the two static Staff Members – Paul Carroll & Nicola Frater)

Instead, I got:
Just the two static Staff Members – Paul Carroll & Nicola Frater

#1733933

Waqar
Supporter

Languages: Inglés (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Craig,

Thank you for contacting us and I'd be happy to assist.

To troubleshoot this on a test website, I'll need to see how this view is set up in the admin area.

Can you please share temporary admin login details of the staging website, making sure that WordPress, active theme and all plugins are updated to the latest versions.

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1735439

Waqar
Supporter

Languages: Inglés (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Craig,

Thank you for sharing the admin access.

During testing on my own website with a similar view, I couldn't reproduce this behavior, which suggests it could be something specific to your website.

To troubleshoot this further, I'll suggest the following steps:

1. Please make sure that WordPress, active theme, and plugins are all updated to the latest versions.

2. It would be interesting to test this with all non-Toolset plugins disabled and a default theme like Twenty Twenty.

If it's fixed, you can start adding the disabled items, one-by-one, to narrow down to a possible conflicting one.

3. In case the issue still persists, I'll need a clone/snapshot of your website so that it can be investigated on a different server.
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )

Please let me know how it goes and I've set your next reply as private.

regards,
Waqar

#1737421

Waqar
Supporter

Languages: Inglés (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Craig,

Thank you for sharing the duplicator package.

I managed to successfully deploy the clone on my server, but I'm getting some conflicting results when testing with different versions of Toolset plugins.

I'll be able to share my final findings, by the end of the day today.

Thank you for your patience.

regards,
Waqar

#1737429

Hi Waqar,

Thank you for the update. I look forward to your final findings.

Best regards,
Craig

#1738481

Hello,

Waqar is in holiday, you will get the answer on Monday as soon as he back.

#1738545

Hi Luo,

Thanks for the info.

Kind regards,
Craig

#1738679

Waqar
Supporter

Languages: Inglés (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Craig,

Thank you for waiting.

I've been performing some testing and research and here are my findings.

With the introduction of Blocks, there have been some major changes around how the query filters and the respective search form fields interact with each other. The query filter is more tightly integrated to the front-end search form fields now, which means that the workaround that you've been using by adding a single search form filter for querying multiple custom fields through the same URL parameter will no longer work. This especially becomes challenging as the custom fields involved are checkboxes type fields, which store data in a special serialized format.

To achieve this with the latest version of the Toolset plugins, you'll need some extra steps:

1. From your view's "Query Filter" section please remove the existing query filter for those 10 custom fields and add them again using the "New filter" button in the "Search and Pagination".

This will add the query filter and the search form select field for each field separately, with a unique URL parameter.

Screenshot of "Query Filter" section:
hidden link

Screenshot of "Search and Pagination" section:
hidden link

2. Now that each custom field will have its own select field in the search form, you'll need some custom script, to select the same value in all the select fields (where applicable), when a value is selected for the first "choose-by-area" field:
( you can add this script in the "JS editor" tab below the "Search and Pagination" section )


jQuery( document ).on( 'js_event_wpv_pagination_completed js_event_wpv_parametric_search_results_updated ready', function( event, data ) {
    jQuery('select[name="wpv-wpcf-choose-by-area"]').on('change', function() {
        jQuery('.wpv-filter-form select.js-wpv-filter-trigger').val(this.value);
    });
});

3. In the "Custom Search Settings" you can select the "Update the View results only when clicking on the search button" and the "Reload the page to update the View results" options.
( screenshot: hidden link )

4. To make sure that these custom field queries are processed with "OR" relationship and not "AND", you'll also need a custom function attached to the "wpv_filter_query" filter:
( ref: https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query )


add_filter( 'wpv_filter_query', 'filter_team_custom_fn', 1000 , 3 );
function filter_team_custom_fn( $query_args, $view_settings ) {

	if ( ( !is_admin() && isset($view_settings['view_id'] ) ) && ( $view_settings['view_id'] == 4569 ) ) 
	{	
		$query_args['meta_query']['relation'] = "OR";	
	}

	return $query_args;
}

5. The last step would be to include some custom CSS code in the "CSS editor" tab below the "Search and Pagination" section so that only the first search filter for the "choose-by-area" field is visible on the front-end and others are hidden:


.wpv-filter-form .form-group {
display: none;
}

.wpv-filter-form .form-group:nth-of-type(1) {
display: block;
}

I hope this helps and please let me know if any step is not clear.

regards,
Waqar

#1739551

Hi Waqar,

This looks amazing, thank you. Unfortunately I am just heading off on holiday for a week, so I will not have the time to implement the steps you have provided until I get back to the office.

I will try to make some time while I am away to test this out and let you know how I get on.

Many thanks once again for looking into this for me.

Kind regards,
Craig

#1741461

Waqar
Supporter

Languages: Inglés (English )

Timezone: Asia/Karachi (GMT+05:00)

You're very welcome Craig and I'll wait to hear back from you.

#1756883

Hi Waqar,

Many thanks again for your help in getting to this point with my problem.

I have applied your amendments and additions and it all seems to be working apart from a couple of slight issues…

When you select a Town, it is automatically updating the “Currently viewing the Community Team for Town Name Here

And then when you click the “Search” button, the dropdown menu is then only populated with the towns which are in the same area as the selected town.

Here is a short recording of the issue – hidden link

Kind regards,
Craig

#1757797

Waqar
Supporter

Languages: Inglés (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Craig,

Currently, the search form in the view is set to update, whenever any input field is changed.

You'll just have to select "Always show all values for inputs" option in the "Custom Search Settings" ( screenshot: hidden link ) and the search form will only update when the submit button is clicked and all input options will always show too.

regards,
Waqar

#1758101

Hi Waqar,

Thank you so much. It is all working perfectly now. I really appreciate your help with resolving my issues.

Kind regards,
Craig

#1758169

Waqar
Supporter

Languages: Inglés (English )

Timezone: Asia/Karachi (GMT+05:00)

You're very welcome Craig and glad I could help.

Please free to mark this ticket as resolved and start a new one one for each new question or concern.

#1758171

Thank you once again!

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