Groupjive module

1 year 5 months ago - 1 year 5 months ago #331703 by galanopd
Replied by galanopd on topic Groupjive module
It doesn't work so let me recap in case something was missed on tthe way...

PAGE GROUPS (community/groups)
Global
Triggers: gj_onDisplayGroup
Type: Code
User: Automatic
Access: Everybody
Conditions
Field: Value
Custom Value: [var2_category]
Operator: Equal  To
Value: 1
Action
Method: PHP
Code:
$usersCount = $variables['var1']->get( '_users', 0 );

$variables['var1']->set( '_users', ( $usersCount ? $usersCount - 1 : 0 ) );
Parameters
References: Variable 1

ISSUE: It is applied to all groups shown and not specifically to groups in category 1

PAGE GROUP (community/groups/1-mycategory/23-mygroup)
Global
Triggers: gj_onBeforeDisplayGroup
Type: Code
User: Automatic
Access: Everybody
Conditions
Field: Value
Custom Value: [var2_category]
Operator: Equal  To
Value: 1
Action
Method: PHP
Code:
$usersCount = $variables['var2']->get( '_users', 0 );

$variables['var2']->set( '_users', ( $usersCount ? $usersCount - 1 : 0 ) );
Parameters
References: Variable 2

ISSUE: Nothing changes. The number of users is not decreased by 1

Please Log in to join the conversation.

1 year 5 months ago #331711 by krileon
Replied by krileon on topic Groupjive module

ISSUE: It is applied to all groups shown and not specifically to groups in category 1

The group object is in var1 for gj_onDisplayGroup so you need to change your [var2_category] in that trigger to [var1_category].

 ISSUE: Nothing changes. The number of users is not decreased by 1

Try removing the condition, but that definitely seams like it should be working. If still not working try turning on debug mode under the parameters tab to see if the auto action is erroring.


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.

1 year 5 months ago - 1 year 5 months ago #331727 by galanopd
Replied by galanopd on topic Groupjive module

The group object is in var1 for gj_onDisplayGroup so you need to change your [var2_category] in that trigger to [var1_category].

GROUPS is now fixed and works fine, thank you

Try removing the condition, but that definitely seams like it should be working. If still not working try turning on debug mode under the parameters tab to see if the auto action is erroring.

GROUP I have removed the condition but no change.

Debug mode result:
Error:: Action 179 :: Code failed. Error: syntax error, unexpected '$variables' (T_VARIABLE)

Inspector in FF in case related:
Error: Promised response from onMessage listener went out of scope ->
background.js:81:14398 ->
var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97, and a thousand pages....

Please Log in to join the conversation.

1 year 5 months ago #331736 by krileon
Replied by krileon on topic Groupjive module
Please be sure you set it up exactly as shown above. Looks like maybe a copy and paste error. There won't be any browser console errors as this should be using Method of PHP. The code is basically the exact same as the first auto action which is working for you except with var2 instead of var1.


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.
The following user(s) said Thank You: galanopd

Please Log in to join the conversation.

1 year 5 months ago - 1 year 5 months ago #331759 by galanopd
Replied by galanopd on topic Groupjive module
I have checked your code a thousand times and both code for GROUPS and GROUP seem identical except var1 and var2.
Then I decided to copy/paste the working code (the one used in GROUPS) to the AA for GROUP and change var1 to var2 and it worked!

So it is definitely something wrong with the second (GROUP) code... maybe (`) or something like that, don't know what to say!
Copying and Pasting the second code doesn't work. Doing the same with the the first code (change only var1 to var2), it does! 

Thank you

 
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.212 seconds