Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[#6093] CB Conditional 3 or more fields

  • AchLive
  • AchLive
  • OFFLINE
  • Posts: 253
  • Thanks: 14
  • Karma: 3
8 years 4 months ago - 8 years 3 months ago #283299 by AchLive
Hi! I need to figure out how to properly run this scenario, it seems that does not work well.
I have 4 fields, all required

Field-A (No conditions - it always see)
Field Value: A1 - A2 - A3

Field-B (Conditioned to the Field-A value)
If the Field-A = A1 then displays Field-B
Field Values: B1 - B2 - B3

Field-C (Conditioned to the Field-A value)
If the Field-A= A2 then displays Field-C
Field Values: C1 - C2

Field-D (Conditioned to the Field-C value)
If the Field-C = C1 then displays Field-D
Field Values: D1

This scenario works well, I can make choices in cascade up to Field-D and can also save the profile data.
The problem comes when I want to change the data stored before because I want to change the cascade fields choices.

Edit profile Scenario where I Selected Field-A on value A3 - the problem arises

Field-A (No conditions - it always see)
If the Field-A = A3 then not displays Field-B and Field-C and Field-D
Field Value: A1 - A2 - A3

[strike]Field-B (Conditioned to the Field-A value)
If the Field-A = A1 then displays Field-B
Field Values: B1 - B2 - B3[/strike]

[strike]Field-C (Conditioned to the Field-A value)
If the Field-A= A2 then displays Field-C
Field Values: C1 - C2[/strike]

[strike]Field-D (Conditioned to the Field-C value)
If the Field-C = C1 then displays Field-D
Field Values: D1[/strike]

When we edit profile scenario fields waterfall is correct but when I want to save requires completion of the Field-B, Field-C and Field-D because they are required but do not see why it's working condition. The mistake is to signal required fields instead are not seen (correctly not seen).

If the first save of the profile I do it with the scenario Field-A = A3 then it works fine.
I noticed that in the database fields are never reset each time you save, this is correct operation?
How can I fix? It could be a bug?
Thanks for the support
Last edit: 8 years 3 months ago by krileon. Reason: Added [#6093] tag to subject

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 4 months ago - 8 years 3 months ago #283315 by krileon
Replied by krileon on topic CB Conditional 3 or more fields
If you want chained fields then they must of course chain. As is you have Field A controlling Field B, C, and D. B has no condition for C and C has no condition for D so it's not a chain. A chain would be as follows.

Field B
Field: Field A
Operator: Equal To
Value: A1
Mode: Show

Field C
Field: Field B
Operator: Equal To
Value: B1
Mode: Show

Field D
Field: Field C
Operator: Equal To
Value: C1
Mode: Show

This would chain as Field A > Field B > Field C > Field D for example.

If you do what Field A controlling B, C, and D then still use Conditional self on Field B, C, and D against Field A instead of Conditional others.

Please also ensure you've latest release installed.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 8 years 3 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • AchLive
  • AchLive
  • OFFLINE
  • Posts: 253
  • Thanks: 14
  • Karma: 3
8 years 3 months ago - 8 years 3 months ago #283391 by AchLive
Replied by AchLive on topic CB Conditional 3 or more fields
Krileon Hi, thanks for the reply.
I tried to follow your suggestion but I still have problems.
I think the problem is how CB Conditional working with the database.
I try to explain.
- I have 3 fields (A-B-C);
Example 1:
Field A (two options) with the first option I display the B field and the field B (two options) with the first option I display the field C. In this case, after saving the database I filled all three fields DataBase (A, B, C) with the respective values.
Now your previous choices to modify and update the profile with
Example 2:
Field A (two options) with the second option is not I display the field B and then even the camp C. Now I upgrade the profile and looking at the database I see that the Field A has been updated with the new value while the B and C fields are not cleared, they still have the values ​​from 1

This scenario makes me problems.

I created an automatic action "before saving your profile" to reset the fields A, B, C, and everything works perfectly.

I hope I have explained well, unfortunately the question is not simple to explain, and I do not speak English well.
Last edit: 8 years 3 months ago by AchLive.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 3 months ago #283425 by krileon
Replied by krileon on topic CB Conditional 3 or more fields
So when you change Field A to hide Field B then Field B value is not being reset? You need to enable value resetting within CB > Plugin Management > CB Conditional > Parameters otherwise it won't reset values.

Additionally only use "Conditional self". So Field B would have a condition against Field A and Field C would have a condition against Field B. "Conditional others" is a bit buggy and tries to essentially in code force a "Conditional self" (conditional others will be removed at some point; so only use if you need to mass condition a large group of fields).

Also if you're testing from backend there's a bug where conditions don't behave properly and require a double save as noted below.

forge.joomlapolis.com/issues/6036


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • AchLive
  • AchLive
  • OFFLINE
  • Posts: 253
  • Thanks: 14
  • Karma: 3
8 years 3 months ago #283427 by AchLive
Replied by AchLive on topic CB Conditional 3 or more fields
Hi, maybe it is not clear what I wrote.
I activated, in the CB Conditional settings, reset, and the field display works well, the thing that does not reset are the values in the table comprofiler DataBase when I already saved at least once the profile data.
So if I try to update the profile data, CB Conditional returns me error on required fields I have compiled before, even though I do not see them (correctly I do not see them).
Every time you save unused fields should be reset. In fact, creating a AutoAction reset that does this work all works well.
I hope I have explained the problem well

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 3 months ago #283437 by krileon
Replied by krileon on topic CB Conditional 3 or more fields
It doesn't reset in database. It resets the display during edit to allow chained conditions. It can't reset in database because it can't account for any and all fieldtypes storage behavior and we've no functionality to force a field value back to NULL at this time. It however shouldn't matter as its display is completely removed.

I've added a feature ticket to see if I can force it, but last time I did it was entirely unreliable (causing fatal errors for some fieldtypes) and will likely have to hardcode behavior for each fieldtype.

forge.joomlapolis.com/issues/6084


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum