[Resolved] Bugs in parametric search, JavaScript (Ajax?) in Views 2.1
This support ticket is created 7 years, 9 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.
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.
First: If I replace Views 2.1 with the older Views 2.0 all problems are solved.
WP 4.5.3, Genesis, Genesis default Child Theme, Layout, Views, Types, Layout-Genesis <- all recent versions
Bugs:
1.) Parametric search does not work. I have a search box with three dropdown menus. What appear in the other two dropdown menus depends on the selection made in the third dropdown menu (parametric search) - this does not work in Views 2.1
2.) Reset button freezes the dropdown menus. Click on Reset and all dropdown menus are grayed out. Only refresh of the page brings them back.
3.) Edit a CPT in WYSIWYG editor. Click on the button "Fields and Views" and click on a Link of a section, which is under the fold of the popup box. Normally it scrolls down to this section, but in Views 2.1 it does nothing.
Please make the next post here in this thread private. I will send you a downloadlink. I made a copy of the website with duplicator (i deleted all other stuff, like styles, images etc. - so the download is small). Download it and you can investigate the bugs.
I am setting the next reply as private so you can share with us the data that you mentioned.
Just as a starting point, we are already aware of the third issue that you mention and we are working on it. In fact, it should be fixed in our next release. So I will focus on the other two about parametric search.
I think you are adding a Duplicator package from your site. If so, please also point out to the Views that are not working as expected and the frontend pages where we can find them.
Thanks for the package. I will focus on the parametric search issues, since the export/import ones are already managed elsewhere. Let me take a look and share my findings here with you 🙂
Congrats! I have been debugging this and I can confirm that we do have a bug here. It is related to your custom structure, the way you are setting forms and results.
I see that you are using a Layout for both the pages that you are reporting issues with. Those pages have a kind of right sidebar, and the content is sided on the left. The right sidebar contains the form in a widget and the left content is used to display the results.
Now, the usual way we use for displaying form and results separated is using a View cell in both cases: when the View contains a parametric search, you can set the View cell to display just the form. I see that you are using a widget instead, and that was what discovered the bug. It seems that we did not address this scenario, and the widget used to display the form is not triggering the right actions nor getting the right data to update itself as it shouls. As a result, neither the form gets updated when it should (your bug number 1) nor the reset button works as expected (your bug number 2).
The good news is that I found the reason and have a first working version. The bd news is that, as this must be labeled as a bug, we need to follow our internal process, so I will fix it on our development branch, then we will have this tested by our team and finally I will be able to provide a patch inside an errata. This might take a couple of days.
I will update you here once we have that patch available. Then, please apply it and confirm that at least the issues 1 and 2 are solved.
great that you have debugged it.
In the prior versions (< 2.1) this ("my") scenario worked fine. So something has changed in 2.1 - probably this hint helps a bit.
Prior to 2.1, we used two different methods for frontend AJAX events: one for parametric search, another for pagination. The one for pagination was not a proper AJAX call but a faked one, and that produced lots of problems. On 2.1 we decided to merge and extend, which is a huge ste forward for us.
A side effect is hat part of the logic used for pagination was used for search. As pagination for Views widgets assumes that you have a full View, the related changes to parametric search on a widget got affected. And we, specially me, failed to address this specific scenario. Now we can have form widgets that can not be managed as full Views widgets. I am guilty.
The good news is that on my tests the solution I found is working totally fine, and I am just waitin gfor confirmation to publish an errata and send you a patch. Anyway, this is getting fixed in our next release for sure.
Toolset is so brilliant,
most of the supporters here help efficient and are nice,
problems in toolset are solved very fast (remember at the shortcodes double quotes, when WP changed its rule to strict),
so, really, I (and also all other customers) have no reason to claim anything.
Toolset is the best plugin I have ever purchased - very happy with it 🙂
I will test the patch, when you send it to me, thanks. Views 2.0 works together with the recent versions of Types and Layouts, so I am able to develop my website without respite in the meantime.
I will now do some checks (deactivate other plugins, switch the theme, etc.). If nothing of this causes the issue, I will duplicate the complete website - there are atm. 39 views, etc.
Oh wohoo, so tricky sometimes. I have/had no cache plugin installed and also deleted browser cache, so I thought, there would be no cache. But the nextend slider had cached it/something (although the slider is NOT on this page - however).
I deleted the nextend slider cache and now your patch works like a charme.
A 1000 thanks for this patch ! I struggled into this for 2 days - get my head up & down and did not find why this is not working. We'd the same behavior and now our filter is working. Thanks to all 🙂
Sorry for the confusion, we needed to release a small update for Views since the new WPML version that was released in sync with WordPress 4.6 also demanded some small changes in our side.
I know we might have inluded the patches in that small release, but we are currently in the middle of our internal testing process to get a complete Toolset update out, and the patches, even after two rounds of testing, do ned to go over that major one before being called done.