Friday, June 29, 2012

Completely blank screen after form submission

In my app, for certain records, after save is clicked, it shows a completely
blank page. The url is pointing at my add view with no id passed. The number
it does this on is a small percentage of them. It works fine and exactly as
I expect it too on all the rest. I have no more ideas as to what it could
be. My add function is below. It's really weird that it would work just fine
on 95% of them but not the rest. Maybe it's something in the data coming in?
But i'm also using the security component, could be that?

function add($id = null) {
$drug = $this->FrenchTranslation->Drug->read(
array(

'Drug.id','Drug.generic','Drug.ahl','Drug.aap','Drug.rid','Drug.oral','Drug.mw','Drug.clinical_recommendations','Drug.category','Drug.lrc','Drug.lrc2','Drug.lrc3','Drug.vd','Drug.rid_range_rounded','Drug.adultdose'
),
$id
);
//$this->set('drug',$drug);
$this->set(compact('drug'));

if (!empty($this->data)) {
$this->FrenchTranslation->create();
if ($this->FrenchTranslation->save($this->data)) {
if(isset($this->params['form']['Next']) &&
$this->params['form']['Next'] == 'Next'){
$this->next($id, $this->data['FrenchTranslation']['generic']);
}
if(isset($this->params['form']['Previous']) &&
$this->params['form']['Previous'] == 'Previous'){
$this->previous($id, $this->data['FrenchTranslation']['generic']);
}
if(!isset($this->params['form']['Previous']) &&
!isset($this->params['form']['Next'])){
$this->Session->setFlash(__('The french translation has been saved',
true));
//$this->redirect(array('action' =>
'edit',$this->data['FrenchTranslation']['id']));
$this->redirect(array('action' => 'edit',$id));
}
} else {
$this->Session->setFlash(__('The french translation could not be saved.
Please, try again.', true));
}
}
$drugs = $this->FrenchTranslation->Drug->find('list');
$this->set(compact('drugs'));
}

--
View this message in context: http://cakephp.1045679.n5.nabble.com/Completely-blank-screen-after-form-submission-tp5709166.html
Sent from the CakePHP mailing list archive at Nabble.com.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: