CB code autoaction with external file

1 year 7 months ago #330787 by activha
Replied by activha on topic CB code autoaction with external file
Yes we need the activity id as we call an external api which send back json with more datas for the activity.
Then I need to store the exact location retrieved from this json in the activity id params.
I did it via a query in our php

This does not work on the after trigger
$variables['var3']->params()->store( 'test', 'test' );

 

Please Log in to join the conversation.

1 year 7 months ago #330788 by krileon
Replied by krileon on topic CB code autoaction with external file
The store is not called on params. It's called on var3. Example as follows.
$variables['var3']->params()->set( 'test', 'test' );
$variables['var3']->store();


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: activha

Please Log in to join the conversation.

1 year 7 months ago - 1 year 7 months ago #330791 by activha
Replied by activha on topic CB code autoaction with external file
Two last questions :
1) does CBsubs also supports substitutions in code autoaction ?
Can I use something like the following to see if a user has an active subscription in plan A for instance?
[code]$subsowner = $action->string($owner, '[subscriptions_plan_A]');;
[/code]

2) I have noticed that trying to add more than one parameter in a php code action fails :
[cb:userfield field="cb_reve_choice" user="#me" /]
displays the correct result with all the html while
[cb:userfield field="cb_reve_choice" formatting="none" user="#me" /]
[cb:userfield field="cb_reve_choice" output="json" user="#me" /]
fails

Can you tell me how to display the field value with all formatting removed (and not the field data) ?
Thanks

Please Log in to join the conversation.

1 year 7 months ago #330798 by krileon
Replied by krileon on topic CB code autoaction with external file
Enable content plugins under parameters then yes you can use CBSubs substitutions in your code action. See the description of the cbsubsbot plugin in Extensions > Plugins for examples of how to use CBSubs substitutions.


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 7 months ago #330805 by activha
Replied by activha on topic CB code autoaction with external file
Thanks for the CBsubs option

Mind to check the double parameters issue in code autoaction ?

Please Log in to join the conversation.

1 year 7 months ago - 1 year 7 months ago #330806 by krileon
Replied by krileon on topic CB code autoaction with external file
It's because your syntax is invalid. User must always come first after Field. The Parameters section in our substitution tutorial below shows the valid order.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb


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

Facebook Twitter LinkedIn