Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Click the trigger input. It's searchable and contains all the triggers available at this time. Any action can be ran on any trigger.- What are the different triggers available for each CB action available , this will avoids me to spend many time to figure out I have a chance to see something triggered. I guess it will be helpfull for everybody anyway.
There is no documentation for triggers. There's only the below, which is out of date.- For the specific example of "onafteruser success" trigger, point to me on documentation for the user / automatic / Specific documentation. I still don't get the CB fields values ... if no documentation, provides me full and detailed explanation of ALL the steps I 'm supposed to implement ( or test ) and not only just the next step as I need to move forward by now.
You're not going to get any output on the trigger you're using. It has no output. So it can't possibly display anything. This is because just after onAfterUserLoginSuccess is a redirect.- If I don't want to use CB HTTrequest, how can I get my curl ran and outputted properly ? can you please point me to documentation or potential restrictions
of CB action ( or this trigger ) for me to debug ?
With a Request action, no. It just sends an HTTP request and that's all. For sending a custom cURL request and processing the results you need to write the code for that in a Code action with Method set to PHP. I can not help you with your custom code.- CB HTTPrequest : can I use the response and use it in a PHP code ., If yes, how ? Can you point me to documentation on CBaction "request" please ?
What PHP version do you have?-> for now, I'm getting an error without using any parameter ( just URL defined ) :
There can be more than 1 login forms displayed. If you've 2 modules or you're on the login page with a login module also displayed then that trigger fires once for each for 2 total. You can check if the session variable already exists. You could even do a simple static var cache like the below to stop double execute (I use these a lot).- How CB action are launched on a page : If I have code ( PHP ) in a CB action , triggered by " on after login form", what triggers this action ? I assume this code should be run once only, when the login form is loaded. why do I have several time code executed ( linked to another post, I need to understand the behavior )
You need a simple authentication plugin. It's like a custom 2-factor login with a session variable being the key. A Joomla authentication bot can accomplish this. You're also validating it after a user has successfully logged in instead of before using onBeforeLogin which can reject the login by setting a plugin error (see the below). No amount of documentation is going to help you with this as it's a very customized and specific implementation.I choose to buy CB to make me win some time and I'm stuck for now with 1 answer per day. I can not spend hours doing troubleshooting or tests because I don't know what should be the right thing to define / configure because I'm missing documentation on normal behavior or way of use. I understand you can not answer straight forward but more frequent update are more than welcome !
Thx for your quick answer and support
Please Log in or Create an account to join the conversation.
krileon wrote:
Click the trigger input. It's searchable and contains all the triggers available at this time. Any action can be ran on any trigger.- What are the different triggers available for each CB action available , this will avoids me to spend many time to figure out I have a chance to see something triggered. I guess it will be helpfull for everybody anyway.
Sorry, my bad english : what are the "configuration" of the existing triggers , ie : which ones generates output ( or not ), which ones has the user available ..etc... this is why I think it could be helpfull for everyone.
There is no documentation for triggers. There's only the below, which is out of date.- For the specific example of "onafteruser success" trigger, point to me on documentation for the user / automatic / Specific documentation. I still don't get the CB fields values ... if no documentation, provides me full and detailed explanation of ALL the steps I 'm supposed to implement ( or test ) and not only just the next step as I need to move forward by now.
www.joomlapolis.com/documentation/279-community-builder/tutorials/18358-using-cb-triggers
To get field values in an action you just need to substitute them. See the below for substitution usage information. All actions are passed through substitutions.
I'm in a code Action
Trigger is ""on afteruser login success"
in general Tab , user option is set to "User" , ( changer from default "automatic")
based on one of the tutorial, I have implemented the following code :
Code:// Get a handle to the Joomla application object for debug $application = JFactory::getApplication(); /// Global $_CB_framework; // $cbUser =& CBuser::getInstance( (int) $_CB_framework->myId() ); if ( ! $cbUser ) { $cbUser =& CBuser::getInstance( null ); } // different attemps to grab username $user =& $cbUser->getUserData(); $myusername = $cbUser->getField( 'username' ); $usernameADV = $cbUser->getField( 'username', 'no value retrieved ', 'txt', 'none', 'list' ); ////////////////////////////////////////////// $application->enqueueMessage(JText::_('usernameADV :' . $usernameADV .'####'), 'error'); $application->enqueueMessage(JText::_('myusername : ' . $myusername .'####' ), 'error'); $application->enqueueMessage(JText::_('myusername : ' . $user->Username.'####' ), 'error'); //////******** DEBUG *******************//// //Retrieve joomla standard field to validate we are connected properly $stduser=JFactory::getUser()->get('username'); ///*************************/// $application->enqueueMessage(JText::_('stduser: ' . $stduser), 'error');
Tutorial or other methods found in forum are not working to display CB value ( while I double chcked that user is properly logged in )
Anything I'm missing ?
www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb
You're not going to get any output on the trigger you're using. It has no output. So it can't possibly display anything. This is because just after onAfterUserLoginSuccess is a redirect.- If I don't want to use CB HTTrequest, how can I get my curl ran and outputted properly ? can you please point me to documentation or potential restrictions
of CB action ( or this trigger ) for me to debug ?
OK
With a Request action, no. It just sends an HTTP request and that's all. For sending a custom cURL request and processing the results you need to write the code for that in a Code action with Method set to PHP. I can not help you with your custom code.- CB HTTPrequest : can I use the response and use it in a PHP code ., If yes, how ? Can you point me to documentation on CBaction "request" please ?
I'm in a code Action ( PHP )
Trigger is ""on afteruser login success"
code is basic :
Curl is not executed while some other action before in the PHP are. any restrictions ?Code:$url="https://www.mysite.com/query?toto=34554RF". "&sessid=".$MyREFSessionID; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); $application->enqueueMessage(JText::_($url), 'message'); // Set so curl_exec returns the result instead of outputting it. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Get the response and close the channel. $response = curl_exec($ch); //$application->enqueueMessage(JText::_($response), 'error'); curl_close($ch); //echo $response; $pieces = explode("&", $response); [ ...etc ]
What PHP version do you have?-> for now, I'm getting an error without using any parameter ( just URL defined ) :
I tried 5.5, 5.6 and just switched to 7.0. any min requirement ?
There can be more than 1 login forms displayed. If you've 2 modules or you're on the login page with a login module also displayed then that trigger fires once for each for 2 total. You can check if the session variable already exists. You could even do a simple static var cache like the below to stop double execute (I use these a lot).- How CB action are launched on a page : If I have code ( PHP ) in a CB action , triggered by " on after login form", what triggers this action ? I assume this code should be run once only, when the login form is loaded. why do I have several time code executed ( linked to another post, I need to understand the behavior )
Code:static $LOADED = 0; if ( ! $LOADED++ ) { SINGLE_EXECUTE_CODE_HERE }
I tried equivalent ... it's a joomla issue, not CB . I will do anther way then ...
You need a simple authentication plugin. It's like a custom 2-factor login with a session variable being the key. A Joomla authentication bot can accomplish this. You're also validating it after a user has successfully logged in instead of before using onBeforeLogin which can reject the login by setting a plugin error (see the below). No amount of documentation is going to help you with this as it's a very customized and specific implementation.I choose to buy CB to make me win some time and I'm stuck for now with 1 answer per day. I can not spend hours doing troubleshooting or tests because I don't know what should be the right thing to define / configure because I'm missing documentation on normal behavior or way of use. I understand you can not answer straight forward but more frequent update are more than welcome !
Thx for your quick answer and support
Code:$_PLUGINS->_setErrorMSG( 'ERROR_MSG_HERE' ); $_PLUGINS->raiseError();
Please Log in or Create an account to join the conversation.
Ones with output almost always are obvious in that sense. For example they often contain "Display", "Form", etc.. Some of the older CB triggers are less obvious though, but from here on triggers should be more clear as to what they do and where. If you're unsure if a trigger has output or not you can simply ask and we'll be happy to help or you can dig into the code and find where it's being executed. I understand such documentation would be helpful, but we're a team of 3 with 2 full time. I don't have the time to maintain such documentation. So my time is spent on support and development. One would need to be sacrificed for documentation (that or my entire personal life).Sorry, my bad english : what are the "configuration" of the existing triggers , ie : which ones generates output ( or not ), which ones has the user available ..etc... this is why I think it could be helpfull for everyone.
Your enqueueMessage usages should output following the redirect. That's standard Joomla behavior unless your action didn't execute, Joomla cleared the queue, or your template doesn't output message queue. You do not need to build a user object for user data in an action. Just substitute it in. For example [username]. Treat all substitutions, at the very least, as string values. So if you need to assign it to a variable surround it with quotes.Tutorial or other methods found in forum are not working to display CB value ( while I double chcked that user is properly logged in )
Anything I'm missing ?
The action is likely executing, but your code maybe erroring (e.g. you've using $application without declaring it then calling a function on it). I can not help you debug your custom code. You can also put your custom code in a PHP file and just do an include in the code action as well if you want a PHP file for it, but you'll lose support for substitutions in your code doing this. If the action isn't executing it's probably failing at the conditions if configured. If an action executed before it does a redirect of any kind then your action also will never execute. The order of your actions on the same trigger is important in that regard.Curl is not executed while some other action before in the PHP are. any restrictions ?
Our current version of Guzzle isn't PHP7 compatible. It has known PHP7 bugs that we can't address yet until CB 2.1 where we'll have to move our minimum PHP requirement to 5.4 to update Guzzle. I recommend PHP 5.6.I tried 5.5, 5.6 and just switched to 7.0. any min requirement ?
Please Log in or Create an account to join the conversation.