This is an odd one, and I can't for the life of me figure out what's
going on. Below is the code:
if (!empty($this->data))
{
// set the user id to the person whom is logged in
$this->data['Project']['user_id'] = $this->Session-
>read('user.id');
$this->data['Project']['date_submitted'] = time();
$thumb = $this->data['Project']['thumbnail']; // store
the file
data
$this->data['Project']['thumbnail'] = '';
// handle the thumbnail upload
$uploaded = false;
if ($thumb['tmp_name'])
{
$tmp_dir = ROOT.'/'.APP_DIR.'/webroot/img/tmp/';
$new_image_name = md5(uniqid(rand(), true));
$uploaded = $this->Upload->uploadFile($thumb,
$tmp_dir.
$new_image_name); // moves the uploaded file to the tmp directory
}
if ($this->Project->validates())
{
if ($this->Project->save($this->data))
{
.etc.etc.
If I leave all fields blank (each field has VALID_NOT_EMPTY for
validation), it still passes and saves and goes to the next screen.
Can anyone see anything blatantly obvious that I'm not seeing?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---