Skip Navigation

[Fixed in next Release] When adding a conditional block, it break the custom field group assignment

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.32 hours from now. 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 8 replies, has 3 voices.

Last updated by ralphN-2 1 year, 11 months ago.

Assisted by: Waqar.

Author
Posts
#2360611

I am trying to:
Work through your step by step guidance for WP directory and classified sites. In chapter #5, when I come to the subchapter "Display Content Conditionally", I am adding a Conditional Block. All of a sudden, the previously created (and used) custom field group "Feldgruppe für Anzeigen" including all its fields isn't available anymore. From that point onwards, also for ANY OTHER purpose/block (e.g. adding a single field) I cannot access the custom field group and it's fields anymore. In the right sidebar of the template editing page, after selecting Post Source "Aktuelle Anzeige" (i.e. current post), under "custom Field Groups" I can only select "Other Fields". My created field group "Feldgruppe für Anzeigen" isn't available or accessible any further. Also, when looking at existing single fields the dropdown "Custom Field Groups" is shown empty, but the field value still seems to be pulled. It essentially breaks the entire setup which I had created before.

Looking forward to your support on this issue.
Thanks! Ralph

#2360631

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2022-05-11 at 11.27.38.png

Hi Ralph

I looked at your site, and neither of the templates includes Conditional blocks, but you do have a template which includes display conditions (i.e. the conditions determine whether the template should be used at all, rather than a Conditional block which determines—within a template—whether something should be output or not).

It's not very intuitive, but when you add display conditions to a template, the post used to preview the template must satisfy those conditions for all of its fields to be available as sources within the template.

See the screenshot. Choose a preview post that matches the conditions, and you should then be able to choose fields from the assigned custom field groups as possible sources.

#2360713
Screenshot at May 11 13-38-29.png

Hi Nigel,

Thanks for your message. I am not talking about the display conditions. I am talking about a conditional block. Have you tried adding one in the content template? For your convenience, I have now added one, please check it out:
hidden link

Now when editing the conditional field, I am able to select current post, but not the custom field group "Feldgruppe für Anzeigen" anymore. As you can see in the other blocks used in the same template, these are using custom fields that are part of the "Feldgruppe für Anzeigen" custom field group (example: "4999 EUR" is a custom field value for the item price).

Right after I tried to add the conditional field the first time, that custom field group became unavailable! The same happened to me yesterday and I reset the entire website and reinstalled Toolset and went through the process again. And the result was the same: after adding a conditional field, it broke the setup.

Thanks you for your support to rectify this issue.

#2360755

Hi Nigel,

in addition to my explanation above, a quick note regarding your remark "Choose a preview post that matches the conditions, and you should then be able to choose fields from the assigned custom field groups as possible sources.":
There is currently only one post in the custom post type "Anzeige", and that post clearly matches the conditions defined in the template's display conditions (i.e. it is in the right category). So there should not be any limitations in displaying any of the fields being used.

You can also replicate the issue I am describing by simply trying to add a single field block anywhere, and try to add a custom field defined within the custom field group "Feldgruppe für Anzeigen". It suddenly isn't possible anymore, somehow this is completely broken. As explained, the issue suddenly occured twice now, right after I tried to add a conditional block for the first time.

Thanks!

#2361371

Waqar
Supporter

Languages: English (English )

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

Hi,

Thank you for sharing these details.

While I can see the issue of the missing custom fields group in the conditional block on your website, I couldn't reproduce the same on my test website.

This suggests that something specific to your website is involved. Do I have your permission to download a clone/snapshot of the website? This will help us in investigating this on a test server.

Meanwhile, you can use the workaround of using the "Advanced Editor" in the conditional block, to add the conditional expression manually.
( screenshot: hidden link )

For example, to show the conditional block's content, only when the "preis" custom field's value is "greater than or equal to" "5000", the expression would like this:


  ( ( '[wpv-post-field name="preis" ]' gte '5000' ) ) 

This guide will help in understanding the conditional expressions:
https://toolset.com/documentation/legacy-features/views-plugin/conditional-html-output-in-views/

regards,
Waqar

#2361375

Hi Waqar,

Thank you so much for following up. I have full permissions and my site is essentially brand new, with just a bare minimum of plugins installed and a very lean theme (Neve). How do you want me to provide the snapshot to you? I will do this asap, awaiting your instructions.

Thanks! Ralph

#2361635

Waqar
Supporter

Languages: English (English )

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

As discussed in our recent chat, I've downloaded a Duplicator package directly from the website.

I'll be performing some tests on it and will share the findings, as soon as this testing completes.

Thank you for your patience.

#2362609

Waqar
Supporter

Languages: English (English )

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

Thank you for waiting, while I performed some tests.

I can confirm that this issue of missing source custom field group, in the presence of display condition(s) for the content template, is already reported. A fix for this is already covered in the upcoming release of the Toolset plugins, which are expected to roll out very soon.

I'll recommend updating the Toolset plugins, as soon as you see the update notification and until then the workaround of using the advanced conditional editor in the conditional block should work just fine.
( ref: https://toolset.com/forums/topic/when-adding-a-conditional-block-it-break-the-custom-field-group-assignment/#post-2361371 )

#2362637

Thank you Waqar for looking into this and for your feedback. I'm looking forward to the coming update! Best regards, Ralph