In broadest terms, I want to have a record created JOB POST that sends an email with a dynamic link to the record to a moderator for approval. Moderator clicks the link, the record is found, and the status is set to approved. I seem to be find the record, but it is not being edited.
Here's my approach in the code:
ADD_NEW_JOB.php
//presents form to describe job post
ADD_JOB_RESULT.php
//this page adds the Job Post to the database and sends an email to the moderator <snip>
$FMStudio_Emailer_body = "New Job Posted for Review. To confirm this post, click this link:
http://talentbase-austin.com/freelance-jobs/jobs/JB_job_new/confirm_jobpost.php?id=<<jobID>>";
</snip>
correctly identifies the job record in the link and presents the following via email:
New Job Posted for Review. To confirm this post, click this link:
http://talentbase-austin.com/freelance-jobs/jobs/JB_job_new/confirm_jobpost.php?id=J1574So far, so good, everything works.
Now, after clicking the above emailed link and returning to confirm_jobpost.php
//I don't get an error, just a blank page and no record update.
CONFIRM_JOBPOST.php [FIND RECORD]
<snip>
$Jobs_find = $FMGreet->newFindCommand('JB_jobs');
$Jobs_findCriterions = array('jobID'=>'=='.fmsEscape($_REQUEST['id']),);
//should find current jobID (e.g. J1574) foreach($Jobs_findCriterions as $key=>$value) {
$Jobs_find->AddFindCriterion($key,$value);
}
fmsSetPage($Jobs_find,'Jobs',10);
$Jobs_result = $Jobs_find->execute();
if(FileMaker::isError($Jobs_result)) fmsTrapError($Jobs_result,"error.php");
fmsSetLastPage($Jobs_result,'Jobs',10);
$Jobs_row = current($Jobs_result->getRecords());
$job_edit_edit = $FMGreet->newEditCommand('JB_jobs',$job_edit_row->getRecordId());
//get currnet recid to edit$job_edit_fields = array('job_status'=>'approved',);
//change status of 'job_status' (text field) to 'approved'foreach($job_edit_fields as $key=>$value) {
$job_edit_edit->setField($key,$value);
}
$job_edit_result = $job_edit_edit->execute();
if(FileMaker::isError($job_edit_result)) fmsTrapError($job_edit_result,"error.php");
$job_edit_row = current($job_edit_result->getRecords());
fmsRedirect('Job_confirmed.php');
//redirect to completion page; thank moderator. </snip>
I'm stumped. Any one see anything glaring wrong with this approach?