From 6f882b38b9d3179f213a6067cc1dddd5315311ad Mon Sep 17 00:00:00 2001 From: james Date: Wed, 2 Mar 2011 17:45:36 +0000 Subject: [PATCH] Remove registrations_id from the mentor object, it gets set when a mentor is added automatically, but should never be changed --- api.php | 2 +- register_participants.inc.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api.php b/api.php index 46f534e..9cecb47 100644 --- a/api.php +++ b/api.php @@ -1072,7 +1072,7 @@ switch($request[0]) { switch($request[2]){ /* APIDOC: project/mentor/edit post(mentors array of mentor arrays) - object(mentor: {id,registrations_id,firstname,lastname,email,phone,organization,position,description}) + object(mentor: {id,firstname,lastname,email,phone,organization,position,description}) object(mentors: {mentor,...}) description(edit a list of project mentors or add new ones if a mentor array has no id) return(mentors array of mentor arrays) diff --git a/register_participants.inc.php b/register_participants.inc.php index 16e7fdd..7b3fad5 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -609,7 +609,7 @@ function userCanEditMentor($userId, $mentorId){ // return a list of fields that should be included in the mentor array function getMentorFields(){ return array( - 'id', 'registrations_id', + 'id', 'firstname', 'lastname', 'email', 'phone', 'organization', 'position', @@ -643,6 +643,7 @@ function saveMentorData($data){ $queryParts = array(); foreach($fields as $key){ if($key == 'id') continue; + if($key == 'registrations_id') continue; $queryParts[] = "`$key` = '{$data[$key]}' "; } $query .= implode(',', $queryParts);