Skip Navigation

[Resolved] Back End fields aren't abiding by the set conditions …

This support ticket is created 2 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.

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: Africa/Casablanca (GMT+01:00)

This topic contains 11 replies, has 2 voices.

Last updated by gordonW-2 2 years, 9 months ago.

Assisted by: Jamal.

Author
Posts
#2123729

Hello.

What would cause toolset to stop properly showing/hiding custom fields (backend) based upon the specified conditions? My custom post types were working just fine, but then the admin side stopped following the set conditions.

Now, fields that shouldn't show up are, and some that are supposed to show up, are not. I know that it isn't a MaxInputVars issue this time as it is set to 3000 and the file using them says that only 1930 are being submitted.

I am running

Wordpress 5.8
Toolset Types v.3.4.11
Toolset Maps v.2.0.9
Toolset Blocks v.1.6

Again, this was all working just fine, earlier today.

#2123913

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting Toolset support.

I have created a new installation that is using the previous versions of WordPress and Toolset:
- WordPress 5.7
- Toolset Types v.3.4.10
- Toolset Blocks v.1.5.2

Would you please reproduce a minimal example of custom fields with displaying conditions. I'll perform the update and check if the issue is reproduced and why it happens. You can log into my test site with the following URL hidden link

If the issue is reproduced, we can assume it is a regression bug introduced by one of the updates and I'll escalate it to our 2nd Tier.

If the issue is not reproduced, I'll need to log into your website and check it closely.

#2124113

Hi there ...

I went ahead and imported my Types data using Toolset's import tool.

I can see the problem happening on your install too.

for example: if you add a new "Product" you can repro my issue.

1. add a new "Product"
2. before selecting / entering anything, look at the fields
There are some named "TuffPlank something" ... they should only be seen when you select "TuffPlank" from the Collection Selector option ... if you can see them when you select "Porcelain / Ceramic / Cotto" then you are seeing my problem
3. Conversely, there are some fields named things like "Installation Use Location" that have an analog like "TuffPlank Installation Use Location" ... you should not see the former, only the latter when you have selected "TuffPlank" in the "collection selector" field
4. Note that when you click "TuffPlank" in the Collection Selector field, that the TuffPlank Sub Selector field correctly displays ... that is how the rest of the page should work

This was all working just fine, until it wasn't ... not sure what happened, but it stopped working as expected.

#2124343

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Can you be more specific? Because as far as I can see the conditions work as expected.

Let's take the "TuffPlank Installation Use Location" field. It should appear when "TuffPlank Sub Selector = Stocked", right!
Stocked is the default value for "TuffPlank Sub Selector", this means that "TuffPlank Installation Use Location" will appear until you change the value of "TuffPlank Sub Selector". The "TuffPlank Sub Selector" does not appear until we select "TuffPlank" in the "Collection Selector".

I guess that the issue is just around the default value of "TuffPlank Sub Selector". Does it make sense?

#2124371

hi there ...

The TuffPlank Sub Selector is the only field that is working as expected ... if you go further down the form, you will see other TuffPlank labeled fields ... they are showing when TuffPlank isn't selected, and their non TuffPlank fields are showing up when TuffPlank IS selected.

Specifically ... If you select "TuffPlank" from the Collection Selector you should only see these fields (below the collection selector):
TuffPlank Sub Selector
Available Colors / Finishes / Options / Textures / Faces / Decor / Patterns / Sizes / Thickness
Installation Shots
TuffPlank Installation Use Location
TuffPlank Installation Location
TuffPlank Plank Thickness
TuffPlank Wear Layer
TuffPlank Finish
TuffPlank Options
Product Shape
Product Size
Product Colorway repeater (following fields:
- Style Name
- Image
- Stocked
- Comment
- TuffPlank Colorway Style Use Location
- TuffPlank Colorway Style Finish
- TuffPlank Colorway Style Options

TuffPlank construction
TuffPlank material type
TuffPlank Installation method

Performance Tests
- TuffPlank performance test name
- TuffPlank performance test method
- PErformance Test value

Notes / Details

Packaging (not used, but you cannot condition check a repeating group)

#2124373

conversely, if you select something other than TuffPlank in the Collection selector -- you shouldn't see ANY fields labeled "TuffPlank"

This was working just fine, until it wasn't and I don't know what went wrong

#2124433

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Most of the TuffPlank labeled fields depend on the "TuffPlank Sub Selector" field value to be Stocked, which is the default value. Check this screenshot hidden link

The default value is used when no values are entered, so, the dependent TuffPlank labeled fields will appear.

I removed the default values, and now it should work as you would expect. Can you check on the test site?

#2124439

It seems to be somewhat working on your test site, but not mine.

on your test site ... the TuffPlank fields still show up if you select something like Porcelain / Ceramic / Cotto

can you take a look here? here is a temp login: hidden link

#2124451

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

It is probably because of the cache. I purged the cache from the admin bar and now it works. Check this screenshot hidden link

#2124453
Screen Shot 2021-07-25 at 4.47.43 AM.png
Screen Shot 2021-07-25 at 4.47.57 AM.png

I tried that ... but fields that have the condition "Collection Selector != TuffPlank" are still showing up.

in the first screenshot ... you can see the field data
in the second ... you can see it still displaying even though Collection Selector = TuffPlank

#2124487

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

It seems that the condition was corrupt. After I switched to the advanced Text mode and put the values between single quotes, it worked. Check this screenshot hidden link
Check the results after purging the cache hidden link

#2124641

It seems that ToolSet's conditional statements can get confused/corrupted unless you add single quotes around each conditional value being set using the Advanced Text Mode'.

Doing this, prevented custom form field conditional-bleed-through on my custom post type posts.

My issue is resolved now. Thank you!

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