0

This was just working perfectly fine 5 minutes ago... I can't for the life of me figure out why this is happening. Basically, I start on a page, with a layout (== 'default'), no where in the controller code do I change the layout, in fact, no where in the application do I change the layout, but for some reason when I hit this certain action named 'addQuestion', it renders the view without a layout...

<?php

// medicalCasesController.php
public function addQuestion($caseId) {
    if ($this->request->is('post')) {
        $this->MedicalCase->Question->create();
        if ($this->MedicalCase->Question->saveAll($this->request->data)) {
            $this->request->data['Question']['id'] = $this->MedicalCase->Question->getLastInsertId();

            $this->MedicalCase->Question->Image->processData($this->request->data);

            $this->Session->setFlash(__('The question has been saved successfully.', true), 'flash/success');
            $this->redirect(array('action' => 'addAnother', $caseId));
        } else {
            $this->Session->setFlash(__('There was a problem saving the question.', true), 'flash/failure');
        }
    }
    $this->MedicalCase->id = $caseId;
    $this->MedicalCase->contain(array('Question'));
    $mc = $this->MedicalCase->read();

    $count = $this->MedicalCase->getQuestions('count') + 1;

    // mc, count, caseId
    $this->set(compact('mc', 'count', 'caseId'));
}

?>

Keep in mind that I see the issue without POST data.. before the form is submitted. Let me know what else you need from me as I'm not quite sure how to diagnose/debug this issue.

Thanks

-Andrew

Andrew Senner
  • 2,479
  • 1
  • 18
  • 24

1 Answers1

0

Figured it out, there was an error in a hidden divide. Silly me..

Andrew Senner
  • 2,479
  • 1
  • 18
  • 24