Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

AutoAction excecute PHP

  • bornakke
  • bornakke
  • OFFLINE
  • Posts: 16
  • Thanks: 0
  • Karma: 0
12 years 11 months ago #186479 by bornakke
Replied by bornakke on topic Re: AutoAction excecute PHP
Hi Krileon,

Sorry about this. I ended out using the onAfterBackendUsersList when i found the other code, but forgot to write it.

Indeed onAfterBackendUsersList should work if the code action is configured properly as it will cause a return/echo (if configured to do so)


This is exactly the conclusion I had reached the first time. But what is properly configured? Could you give me at least one example of some working code then I should be able to figure out the rest by my self. Even doing something simple as:
$test = \"testing\";
return $test

is returning a empty array if using php eval and giving me the following error when trying php function:

Parse error: syntax error, unexpected '"', expecting T_STRING in /public_html/components/com_comprofiler/plugin/user/plug_cbautoactions/models/code.php(38) : runtime-created function on line 1

Fatal error: Function name must be a string in /public_html/components/com_comprofiler/plugin/user/plug_cbautoactions/models/code.php on line 39

Best regards
Tobias

PS: I have written around 10 joomla component by my self so no need for assistance on the debugging...

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48569
  • Thanks: 8293
  • Karma: 1445
12 years 11 months ago #186488 by krileon
Replied by krileon on topic Re: AutoAction excecute PHP
Appears there is a bug on how content is output. Need to review further and have created the below bug ticket for investigation. If can find acceptable solution in a timely manner will try to release new build today.

forge.joomlapolis.com/issues/3121


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 or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48569
  • Thanks: 8293
  • Karma: 1445
12 years 11 months ago #186490 by krileon
Replied by krileon on topic Re: AutoAction excecute PHP
Released 2.1.2 that fixes proper returning of values, but usage of that trigger seams rather tricky. It appears you need a list of the userids in an array of an array. Example as follows.

Code:
Code:
return array( 'Column Name' => array( USER_ID => 'Users Value' ) );
Method: Return

The thing is if there is a user_id missing from the array you'll get an error, so in your code you'll also need to get a list of user rows, which is normally provided by the trigger it self however you won't have access to that var in CB Auto Actions.


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 or Create an account to join the conversation.

  • bornakke
  • bornakke
  • OFFLINE
  • Posts: 16
  • Thanks: 0
  • Karma: 0
12 years 11 months ago #186886 by bornakke
Replied by bornakke on topic Re: AutoAction excecute PHP
Hi again,

The new release do inded fixes the issues. I also reached the conclusion that it needed to return an array as the sugested form. I'm however not understanding why i can't access the $row value? It seems like it is being send along with the plugin trigger?

Best regards
Tobias

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48569
  • Thanks: 8293
  • Karma: 1445
12 years 11 months ago #186893 by krileon
Replied by krileon on topic Re: AutoAction excecute PHP
CB Auto Actions does not have access to the triggers variables. The only variable it trys to process is the $user variable. In addition to that the Code action isolates the code into its own process and it can not access the variables inside the function preparing it (but does support 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 or Create an account to join the conversation.

  • bornakke
  • bornakke
  • OFFLINE
  • Posts: 16
  • Thanks: 0
  • Karma: 0
12 years 11 months ago #186895 by bornakke
Replied by bornakke on topic Re: AutoAction excecute PHP
Hmm... what a shame. I guess i will have to once again move back to hacking CB.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum