Autoactions for 2 different views for 2 profile types

10 years 7 months ago - 10 years 7 months ago #234049 by crony
Hello,

I'm on that one for all day, so I'm almost sure it require custom code into autoaction, but let's talk about my problem...

To resume, I would like to have an autoaction that change the content of a cb field depending on a cb field already populated, AND executing differently depending on group of Joomla where the user belongs...
At the moment, it works depending on what's into cb field, but it does not apply depending on groups where users are belonging.
So I have the same results while the 2 types of users are connected, which is not ok.
I don't know how to make understand into autoaction the user group in which the connected users (and viewers of profile) belongs...


Here's my usecase :

I'm trying to setup a kind of dating site.

I have 2 types of users, male, and female.
In cbsub, I've created 2 plans, each plan assign a user to a group : men into "male" group, women into "female" group.

I'm also using cp profile pro, having 4 different profiles :
-Man profile
-Man profile being viewed(by woman)
-Woman profile
-Woman profile being viewed(by woman)

I have setuped 4 autoactions : (in facts I would need 6, but let's keep it simple)
-1 onBeforeUserProfileDisplay to assign a field value (profile type) while a man seing his profile
-1 onBeforeUserProfileDisplay to assign a field value (profile type) while a man is going to watch a woman profile

-1 onBeforeUserProfileDisplay to assign a field value (profile type) while a woman seing his profile
-1 onBeforeUserProfileDisplay to assign a field value (profile type) while a woman is going to watch a man profile












All seems to work fine, while I'm authentified as a man, if I go to:

a woman profile, the profile is being changed, here's the debug lines :string(78) ":: Action 8 :: Access check for 29 failed: looking for 11 in -1, -4, -3, 2, 10" string(78) ":: Action 3 :: Access check for 29 failed: looking for 11 in -1, -4, -3, 2, 10" string(66) ":: Action 7 :: Conditional 1 failed for 29: [gids] Does Contain 10" string(64) ":: Action 4 :: Conditional 1 failed for 29: Male Equal To Female"
FemmesPourHommes

The user himself profile :
string(78) ":: Action 8 :: Access check for 29 failed: looking for 11 in -1, -4, -3, 2, 10" string(78) ":: Action 3 :: Access check for 29 failed: looking for 11 in -1, -4, -3, 2, 10" string(66) ":: Action 7 :: Conditional 1 failed for 29: [gids] Does Contain 10" string(64) ":: Action 4 :: Conditional 1 failed for 29: Male Equal To Female"

But, if I'm authentified as a woman, I don't have the profile changed ! It's like if I was a man (sorry, a bit tired here...)

So as a woman, trying to see the man profile :
string(66) ":: Action 8 :: Conditional 1 failed for 28: [gids] Does Contain 11" string(64) ":: Action 3 :: Conditional 1 failed for 28: Female Equal To Male" string(78) ":: Action 7 :: Access check for 28 failed: looking for 10 in -1, -4, -3, 2, 11" string(78) ":: Action 4 :: Access check for 28 failed: looking for 10 in -1, -4, -3, 2, 11"

As a woman trying to see her proper profile:

string(66) ":: Action 8 :: Conditional 1 failed for 28: [gids] Does Contain 11" string(64) ":: Action 3 :: Conditional 1 failed for 28: Female Equal To Male" string(78) ":: Action 7 :: Access check for 28 failed: looking for 10 in -1, -4, -3, 2, 11" string(78) ":: Action 4 :: Access check for 28 failed: looking for 10 in -1, -4, -3, 2, 11"

FemmesPourHommes

J! 4.x - CB 2.7.3

Please Log in to join the conversation.

10 years 7 months ago - 10 years 7 months ago #234050 by crony








Indivudualy, all actions are well executed, it seems there's a problem with the 4 actions at the same time...

It drives me crazy...

I'm wondering if code would be better, as it seems it's messing with the groups rights.

Also, I think if this work, I would need 2 more actions, to assign an other profile to woman that have launched a connexion with a man, and while the man have been accepted by the woman.

And it will be good for that part...

Sorry for such a long post, but it's very hard to be shorter...

Versions :
J! 3.1.5 CB 1.9 Autoaction 5.1.3

J! 4.x - CB 2.7.3
Attachments:

Please Log in to join the conversation.

10 years 7 months ago #234068 by krileon
Your main issue seams to be a conditional for [gids]. I doubt that'll work. If you need an action applied to a specific usergroup then use the Access parameter and not [gids] or [gid] in a conditional as it's going to be "iffy" on whether it'll work or not. I'm not so sure it's a good idea to be flipping a field like that and you're better of using CB Conditional to condition different profile displays (you can use Custom Value to condition based off the viewing users field data).


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.

10 years 7 months ago #234081 by crony
Ok thanks, but I need more info as I don't get it... lol

use the Access parameter


Where's that Access parameter ?

But do you mean I should use anyway CB conditionnal in fact for all that ?
I'll give it a try, but my system is much more flexible in term of design in fact and to maintain also...

J! 4.x - CB 2.7.3

Please Log in to join the conversation.

10 years 7 months ago #234092 by krileon

Where's that Access parameter ?

The access parameter in your auto action. Notice in the debug output that [gids] is not substituting so it's always failing there.

But do you mean I should use anyway CB conditionnal in fact for all that ?

If you're trying to show/hide various tabs/fields based off the viewing users field values then yes you can do this with CB Conditional and its Custom Value usage then just substituting in the viewing users field values.


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.252 seconds

Facebook Twitter LinkedIn