When I try this, I still get an empty screen (except for my layout)
like before.  I tried making the second parameter to debug true with
the same result. So I'm not seeing the results anywhere of running

$var = $this->OsChoiceHistory->validationErrors;
debug($var);
die();

and

$var = $this->OsChoiceHistory->validationErrors;
debug($var, true);
die();

ditto for invalidFields()

does this mean there are no validation errors or invalid fields?  I'm
guessing this is the case because I have not set any validation rules
in the model.



On Dec 17, 9:51 am, euromark <[email protected]> wrote:
> I already gave you the answer in my previous post
> anyway:http://book.cakephp.org/2.0/en/development/debugging.html?highlight=d...
>
> for starters you can simply output and die:
>
> $var = $this->OsChoiceHistory->validationErrors;
> debug($var);
> die();
>
> On 17 Dez., 18:35, roundrightfarm <[email protected]> wrote:
>
>
>
>
>
>
>
> > did you try to debug     $this->OsChoiceHistory->validationErrors or
> >   $this->OsChoiceHistory->invalidFields()
>
> > how do I do this? and where do I go to see the results?
>
> > Thanks
>
> > On Dec 17, 9:26 am, euromark <[email protected]> wrote:
>
> > > did you try to debug
> > >     $this->OsChoiceHistory->validationErrors
> > > or
> > >     $this->OsChoiceHistory->invalidFields()
> > > ?
> > > they should contain an array of fields that probably made sure the
> > > save was unsuccessfull
> > > it would also be wise to debug the result of the last save()
> > >     $res = $this->OsChoiceHistory->save($new_entry);
> > >     debug($res);
>
> > > On 17 Dez., 18:17, roundrightfarm <[email protected]> wrote:
>
> > > > I can't create a new record in my database table.
>
> > > > Here is the code I am using
>
> > > > [code]foreach($boxes as $box) {
> > > >                         //check and see if the box's owner has any 
> > > > optional shares
> > > >                         //if they do, add the product to the boxes item 
> > > > table so it will be
> > > > included with their order list and aggregate product order totals
> > > >                         $optional_share_users = 
> > > > $this->OptionalShareUser->find('all');
> > > >                         foreach ($optional_share_users as $share_user){
> > > >                                 if ($box['Box']['user_id'] == 
> > > > $share_user['OptionalShareUser']
> > > > ['user_id']){
> > > >                                         $this->BoxesItem->read(null, 
> > > > $box['Box']['id']);
> > > >                                         $this->BoxesItem->create();
> > > >                                         $new_optional_share_item = 
> > > > array(
> > > >                                                 'BoxesItem' => array(
> > > >                                                         'box_id' => 
> > > > $box['Box']['id'],
> > > >                                                         'item_id' => 
> > > > $share_user['OptionalShareUser']
> > > > ['current_product_id']
> > > >                                                 )
> > > >                                         );
> > > >                                         
> > > > $this->BoxesItem->save($new_optional_share_item);
>
> > > >                                 //now make a new record for the item in 
> > > > the os_choice_history
> > > > table
>
> > > >                                         
> > > > $this->OsChoiceHistory->create();
> > > >                                         $new_entry = array(
> > > >                                                 'OsChoiceHistory' => 
> > > > array(
> > > >                                                         'week_id' => 
> > > > $current_shown_week_id,
> > > >                                                         
> > > > 'optional_share_id' => $share_user['OptionalShareUser']
> > > > ['share_id'],
> > > >                                                         'user_id' => 
> > > > $share_user['OptionalShareUser']['user_id'],
> > > >                                                         'item_id' => 
> > > > $share_user['OptionalShareUser']
> > > > ['current_product_id']
> > > >                                                 )
> > > >                                         );
> > > >                                         
> > > > $this->OsChoiceHistory->save($new_entry);
>
> > > >                                 }
> > > >                         }
>
> > > >                         [/code]
>
> > > > This code runs without any errors, and the first half works to save to
> > > > the boxes_items table, but the second half leaves the
> > > > os_choice_histories table unchanged.   Any ideas what I'm missing here

-- 
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
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to