php Script not executing despite tests being successful

  • OTWD
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
1 week 5 days ago - 1 week 5 days ago #166667 by OTWD
Hi I am trying to run a php script using the plugin.
I have setup a subscription and on the php Script tab I have entered the following to test:
echo $row->organization;
die();
This did echo 123456 on a blank page successfully.
I then want my script to update all users who have a registration field that matches the $row->organization and move them to a different joomla group.
This code executes perfectly as a cron job for example (for testing I change $targetFieldValue = 123456 ).
When I run the same code in the Subscription Active Script box nothing happens. Why wont it execute in your script box? 
Code is uploaded as screenshot as your sucuri firewall prevents uploading of code.

 

Success consists of going from failure to failure without loss of enthusiasm.
Last edit: 1 week 5 days ago by OTWD.

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

More
1 week 5 days ago #166673 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic php Script not executing despite tests being successful
It's simple, the $row variable is not available for using inside the script

I would suggest you to add the code inside the method directly to the script box. You do not need to write a class, add a method and then call the method

Just put the code inside the method moveUser directly to the script box, then save it and try again

Regards,

Tuan
The following user(s) said Thank You: OTWD

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