Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi

SUJET : RemoteControl add_participants problem

RemoteControl add_participants problem il y a 10 mois 2 semaines #100415

  • jday
  • Portrait de jday
  • Hors ligne
  • Fresh Lemon
  • Messages : 4
  • Karma: 0
Hello,

I'm having a problem using the RemoteControl2 function add_participants. Specifically, there seems to be a problem with passing the participant data parameter.

From what I gather from the manual and from the source of survey/application/controllers/admin/remotecontrol.php, this function expects the parameter to be a json-encoded array with keys that need to match the column names for this survey's specific token table. The manual shows a participant being added with just an email address, first name, and last name, so I'm attempting to add with this info. Like this: {"email":"me@example.com","lastname":"Bond","firstname":"James"}

The problem is that the function just returns the participant data parameter, no error, and does not insert a record into the table. Interestingly enough, if I call the function with badly formatted participant data, it will insert a record into the table with just a token and the table defaults.

Has anyone else run into this? Is anyone able to successfully use this function?

Thanks for your time!
L'administrateur a désactivé l'accès en écriture pour le public.

RemoteControl add_participants problem il y a 10 mois 2 semaines #100423

  • jday
  • Portrait de jday
  • Hors ligne
  • Fresh Lemon
  • Messages : 4
  • Karma: 0
Ok, it turns out that I was just using this incorrectly.

instead of passing add_participants an array of user info, I wanted to pass it an array of arrays of user info.

So instead of:
$participantdata = array(
'email' => $email,
'lastname' => $last_name,
'firstname' => $first_name
);

I should have done something like:
$participantdata[] = array(
'email' => $email,
'lastname' => $last_name,
'firstname' => $first_name
);


My mistake, but I hope this helps anyone else having the same problem.
L'administrateur a désactivé l'accès en écriture pour le public.
Modérateurs: ITEd
Temps de génération de la page : 0.129 secondes
Donation Image