Skip Navigation

[Resolved] Custom Select Field Filters in WordPress archive, created with Toolset Layouts, do not work

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

Problem

I created an Archive using a Toolset Layouts Archive Cell and inserted Custom Searches as select Fields.

Those custom fields do not show any search options on the archive page’s front-end.

This support ticket is created 6 years, 8 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.

Our next available supporter will start replying to tickets in about 2.01 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 23 replies, has 2 voices.

Last updated by Beda 6 years, 8 months ago.

Assisted by: Beda.

Author
Posts
#620632

Thanks.

Locally, after disabling all Plugins but Toolset and WPML, on my-site.com/diamants I see nothing.
There is no View, no Archive, and no Layout assigned only some (previously mentioned) errors.

So I re-assigned the Layout and Archive you shared in the last post.

Trying to do that, I receive "Une erreur est survenue pendant la requête ajax, assurez-vous que les données que vous envoyez sont en format json." from Layouts.

I can't change the layouts assignement.

Hence I also activated 2017 Theme.
I still get the same error, and still there is that PHP script echoing allover:

'Widget Social', 'id' => 'new-widget-area', 'before_widget' => '
', 'after_widget' => '
', ) ); } add_action( 'widgets_init', 'social_widgets_init' );

Did you alter the WP Core files?

I assume so, becuase the issue is still there even if you disable all plugins and themes and use WordPress only, and we do not assist customized Installs, I am sorry:
https://toolset.com/toolset-support-policy/

Please provide to me a Website that does not fail on it's basics. This website cannot work with any Plugin, it has issues right in the core of WordPress Files.

I will make more tests tomorrow related to all these issues, but I can already tell that without fixing the native WordPress install which is not native anymore in this case, we will not be able to solve any follow up issue either, logically.

I will make some tests tomorrow by hacking the database and change assisgnements, but that is only necessary because it seems the WP Install is simply not working.

#621078

I don't modify the core, i install on other website Toolset without other plugins and i have the same issue : don't work.

#621324

OK.

I know that the install is modified because I deployed it locally and failed.
It might be that some security PLugins does that and is not removing it's settings if simply deactivated.

To confirm, I let my colleagues look at this.

#621331

If you want i have a clean instalation with the same problem.

#621339

Yes, please.

This is what I was asking for. The current site I received seems not duplicable.

A clean install where the issue is replicated would help greatly since I cannot replicate this myself on a clean install, as I tried several times.

I re-activated a private reply for you to provide that copy.

Thank you!

#621346

Wait.
A colleague was able to replicate the package and showed me how to succeed.

I am trying again now.
Please apologise the hiccup, I will be with you in short.

#621381

Great, I deployed the Site.

I managed to find the Front End URL which is not reachable by menu on the Duplicator:
site.com/categorie-produit/diamants/

From there, I found the Layout and Archive used:
site.com/wp-admin/admin.php?page=dd_layouts_edit&layout_id=619&action=edit
(Has a PHP error: ( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in .../wp-content/plugins/layouts/classes-auto/WPML/wpddl.layouts-wpml.class.php on line 88, is reported already:)

On my copy of this site, this layout is not assigned anywhere.
Taxonomie non définie archives - (aucun aperçu disponible)

But, since it is the layout and archive you use on the live site, I used it to debug too and tried to assign the proper archive.
But that does not work, there are JS errors and the Layout assignment cannot be changed.

The unexpected is, that even with a fresh copy of the Twenty Seventeen Theme and only Toolset, I still see the JS errors, and as well the unexpected PHP output everywhere on the screen.

Even if I fully disable all plugins, and use a fresh Twenty Seventeen Theme, the unexpected PHP output is still there.

The code comes from 2 places in your site:
wp-config.php:

   43   * Clefs uniques d'authentification et salage. 
   44  
   45:  'Widget Social', 'id' => 'new-widget-area', 'before_widget' => '
   46  ', 'after_widget' => '
   47  ', ) ); } add_action( 'widgets_init', 'social_widgets_init' );

wp-content/mu-plugins/socialwidget.php:

    5   register_sidebar( array(
    6  
    7:  'name' => 'Widget Social',
    8   'id' => 'new-widget-area',
    9   'before_widget' => '<div class="allcentersocial">',

That's how I discovered the 4 MU plugins used, and deactivated them.

I then re-activated Toolset Views, Types and Layouts, using the Twenty Seventeen Theme, and logically WooCommerce.

I was now able to perfectly fine assign and edit Layouts, with no error.
No error is anymore happening or displaying anywhere.

Now, the issue with the not showing Custom Fields in the Search is still happening, but since we are now at least able to work on the site, we can find the cause for this.

I did these experiments (using the clean install I got as after above steps):
- disable Toolset Layouts, create a new WordPress Archive for the category, including a field as search dropdown (poids):
works fine, the fields are shown
- activate Toolset Layouts, and call the above new archive
works fine too, all fields are shown
- inserted the old Archive (the one you are using) in the Layout:
it fails, even if I recreate the filters.

I made the last test to be sure:
- create a new Archive Cell directly in Layouts

This is the source of the issue.
If you create the new archive cell directly in Toolset Layouts it will fail to load those fields.

So, for you, right now, the best solution is:
- delete the current Cell in the Layout
- head to Toolset > WordPress Archives
- create a new archive
- complete the archive and save it
- head to Toolset > Layouts > The Layout you use in that archive (categories)
- Insert the above created new Archive, using the Toolset Layouts Archive Cell (you can choose from already existing archives).

That should solve the problem on your install, although I am not sure it will work as due to the other errors that I faced on the site which IU describe above how to avoid them.

I will now try again with this new steps to recreate this in clean or escalate this to my superiors for further debugging.

Thank you for your patience.

#621390
#621643

Sorry, my previous lengthy message, I wanted to share as well the steps I take, it can be helpful to you or others in future as a reference to see how we can discover where the problem is.

Here again the workaround:

So, for you, right now, the best solution is:
- delete the current Cell in the Layout
- head to Toolset > WordPress Archives
- create a new archive
- complete the archive and save it
- head to Toolset > Layouts > The Layout you use in that archive (categories)
- Insert the above created new Archive, using the Toolset Layouts Archive Cell (you can choose from already existing archives).

That should solve the problem on your install, although I am not sure it will work as due to the other errors that I faced on the site which IU describe above how to avoid them.

Can you confirm this works for you?

As soon I recreated this issue in a clean install I will as well try to create an Erratum here:
https://toolset.com/known-issues/
This way, everyone will be updated.

#622650

Hello,

thanks but i try this with the new and clean instalation without plugins, mu-plugins or anything and the result is the same : don't work.

#622920
Front End Search of this Archive.png
Insert New Archive Cell.png

Well, it works on the package I received from you after performing all the steps outlined above.
I tested this numerous times.

If it does not work, can you explain at what point it fails?

Meanwhile, I also downloaded your second package, where the URL site.com/categorie-produit/diamants/ is a 404 once again
and is to be found instead in site.com/categorie-produit/diamant/

The Layout used here as well uses a Layout Archive Cell, and as soon you replace that Archive Cell by an Archive created in Toolset > WordPress Archives, it works.
I have added a ScreenShot on how to assign the correct archive.

The steps are:

1. Toolset > WordPress Archives
2. Create a new Archive for "Catégories de produits"
3. Complete the Search and Loop forms
4. Save and insert it into the Layout as shown in the ScreenShot.

Now, on the Front-end, you can see the Custom Search is populated with values from the fields.

I am able to replicate this BUG now.
If you create the archive cell within Layouts, the Filters will not work.
If you create the archive outside of Layouts and then insert it in Layouts it works.
This happens only if it is a WooCommerce Taxonomy.

I escalated it and will publish an errata with the above working workaround as soon as possible

#623090
tool3.png
tool2.png
tool1.png

ok, ok it's work thanks ; but a strange thing .

please look a screennshot :

the first there is 4 "oui" for 6 results / when i select this only 3 "oui" display and after when i reset there is only 5 results.

you know the problem ?

thx

#623245

No, I do not know how that oui/non are added, eventually, those are HTML conditionals in a Table, but this is a different topic.

I suggest you open a new ticket with this particular problem.
It will be important that we know how to replicate the specific situation, what you use to build the loop.

Then, we can analyse this and help you better.

#623326

Ok, thanks Beda.

#623703

I was able to replicate this problem as well without WooCommerce.

I published an erratum describing the issue and providing the current workaround.
https://toolset.com/errata/custom-select-search-fields-in-toolset-layouts-archives-stay-empty/

I will update there, once we have a proper fix for it or more news.