[#7610] Trouble with Conditional hide for Tabs for both view profile and edit profile

4 years 9 months ago #313001 by rgarderet
Hi Kyle,
It seems to work well now - thanks again.
But in testing certain conditions, I found one thing that threw me off, and I'm not sure if its by design or a bug.
I want to have a field show up only for certain types of users, when editing and viewing their own profile

If I set a field condition like the following:
Show field, if cb_profile_id = [cb:userdata field="Id" user="#me" /] AND cb_profile_type = "business"

If I set the location to both conditions as "view" only, everything works fine for both editing and viewing
If I set the location to also include "Edit", the field shows/hides as expected, but any change the logged in person makes to themselves is not saved.(although the message says it is).

Not sure if that is clear, or something to test at your end. In my case, I just keep the location to "view" only, and it seems to be applying to "edit" anyway, but it took a while to figure out.
Thanks,
Remy.

Please Log in to join the conversation.

4 years 9 months ago #313014 by krileon

Show field, if cb_profile_id = [cb:userdata field="Id" user="#me" /] AND cb_profile_type = "business"

Your user id condition is likely not working as expected. Recommend using the below to check if the profile owner and viewing user are one in the same.

Field: Custom > Value
Value: [user_id]
Operator: Equal To
Value: [cb:userdata field="user_id" user="#me" /]

If I set the location to also include "Edit", the field shows/hides as expected, but any change the logged in person makes to themselves is not saved.(although the message says it is).

Even changes to tabs or fields that don't have conditions? Enable debug mode and maximum error reporting in Joomla global configuration. Next edit your condition and at the bottom enable debug mode for the condition you suspect is working incorrectly and save the profile. This should output debug messages if any errors occurred as well as what values your conditions are seeing. I'm not seeing any further issues in my tests and suspect it's just a condition configuration problem caused by your user id check.

Not sure if that is clear, or something to test at your end. In my case, I just keep the location to "view" only, and it seems to be applying to "edit" anyway, but it took a while to figure out.

That should not be the case. If the condition is set for profile view only it should not be applying at all to profile edit. This was fixed in the latest build. Please be sure you've updated CB Conditional.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.189 seconds

Facebook Twitter LinkedIn