Remove registrations_id from the mentor object, it gets set when a mentor is added automatically, but should never be changed

This commit is contained in:
james 2011-03-02 17:45:36 +00:00
parent 693fb1e398
commit 6f882b38b9
2 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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);