Skip to Content Skip to Menu

Start PHP file after picture update

  • GUEST
9 years 11 months ago - 9 years 11 months ago #253865 by
Can you please give some pointers where the post/get url should be configured in the auto Actions plugin. I am not sure which action method for this to choose.

Never mind, found it. Was not clear that on the Global tab the type must be selected first.
Last edit: 9 years 11 months ago by .

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

  • GUEST
9 years 11 months ago #253869 by
No luck so far.

I tried this config in CB V2.0.3/Auto Action 6.0.1:

On Global tab, triggers After Avatar Update (and also tried After Frontend Profile Update)
Type is set to request

On Conditions tab:
Left empty

On Action tab:
Method is Post
URL: valid url to PHP file (php file just echo "OK", if tested this URL from browser, I see the "OK")
Body & header: Left empty
Authentication: None
Return: echo

In the front of CB I did My Profile->Edit->Update Your Profile -> Portrait->Select new image from gallery->selected new omage->Update

I would expect to see a POST to the php file defined in the URL.
In Firebug I see only one POST to another URL, so not Posting the php file.
In Apache access.log I only see the same POST URL, not any POST to the PHP file.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48501
  • Thanks: 8284
  • Karma: 1443
9 years 11 months ago - 9 years 11 months ago #253894 by krileon
Replied by krileon on topic Start PHP file after picture update
I was able to confirm the Request action is sending the POST/GET requests perfectly fine. However, the output does appear broken. You are not going to see anything in Apache or Firebug network logs.

Firebug can only record user HTTP requests; this is server side. Apache does not record access logs to it self (your server is sending an HTTP request to it self). So your script is working, but it's just not going to return any output. Have created a bug ticket to fix the output issue for next release.

Also keep in mind many triggers happen during PHP operation where a redirect immediately occurs and the only way to debug output during those times is to enable debug mode and maximum error reporting, which will cause CB to pause the redirect.

forge.joomlapolis.com/issues/4902

Also note you can save on server resources by using a Code action and just doing an include of your script if it's on the same server that you're performing the auto action.


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.
Last edit: 9 years 11 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48501
  • Thanks: 8284
  • Karma: 1443
9 years 11 months ago - 9 years 11 months ago #253895 by krileon
Replied by krileon on topic Start PHP file after picture update
Ok, investigated further and the output is also working fine except var_dump. Guzzle uses a magic method to convert it for echo output so that's not an issue. To test your code use the before profile display trigger, set the "Return" to "Echo", then ensure your PHP file has an echo ( e.g. echo 'Test'; ). I've confirmed this case as working and the echo outputs fine.


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.
Last edit: 9 years 11 months ago by krileon.

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

  • GUEST
9 years 11 months ago #253897 by
Ok thanks, will put something meaningful into the script as to see if it works.
Thanks for the server side tip. Didn't think of that till you mentioned.
If it works I'll try to include it in action code.

One more question, how to debug this mechanism?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48501
  • Thanks: 8284
  • Karma: 1443
9 years 11 months ago #253901 by krileon
Replied by krileon on topic Start PHP file after picture update
There isn't really any debug code in place for individual actions. It's planned, but I just haven't gotten around to implementing it. Right now you can enable debug mode for an action under the Parameters tab, but it'll only debug Access and Conditionals at this time. The best way to debug a Request is set the Return to var_dump or Echo then ensure debug mode and maximum error reporting is enabled in Joomla global configuration (this is absolutely vital or you will not see debug output during redirects).


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.

Moderators: beatnantkrileon
Powered by Kunena Forum