Hi all,

Long time CodeIgniter user coming to CakePHP...

I have been following the cake naming scheme and everything works 
awesome... except one thing.

I have a RequestRecord model/table and a RequestHistoryStatus model/table.

>From in my RequestRecords controller I am trying to validate/save a form 
that write to both tables.  I have setup the RequestRecord model as a 
"hasMany" relationship with the RequestHistoryStatus.

When I do:
$this->RequestRecord->saveAll($this->request->data, array('validate' => 
'only')) it does indeed validate both tables... however the error message 
from my RequestHistoryStatus model is not being passed.

How the validation is setup in the RequestHistoryStatus model:
public $validate = array(
        'notes' => array(
            'rule' => 'notEmpty',
            'required' => true,
            'allowEmpty' => false,
            'on' => array('update', 'create'),
            'message' => 'Please enter any notes for this request.'
        ));

Resulting array that is produced when the field fails validation:

Array
(
    [link] => Array
        (
            [0] => Please enter a link.
        )

    [description] => Array
        (
            [0] => Please enter a description of the request.
        )

    [total_cost] => Array
        (
            [0] => Please enter the cost of the request.
        )

    [initial_support] => Array
        (
            [0] => Please indicate if initial support is provided or not.
        )

    [future_support] => Array
        (
            [0] => Please indicate if future support is required or not.
        )

    [delivery_location] => Array
        (
            [0] => Please select a delivery locatoin.
        )

    [delivery_person] => Array
        (
            [0] => Please enter a delivery person.
        )

    [tech_fee] => Array
        (
            [0] => Please select a tech fee.
        )

    [marketsite_non_vendor] => Array
        (
            [0] => Please select a Non Marketsite Vendor or "Not listed".
        )

    [vendor_address] => Array
        (
            [0] => Please enter the vendor's address.
        )

    [vendor_city] => Array
        (
            [0] => Please enterthe vendor's city.
        )

    [vendor_state] => Array
        (
            [0] => Please select the vendor's state.
        )

    [vendor_zip] => Array
        (
            [0] => Please enter the vendor's zip code.
        )

    [vendor_email] => Array
        (
            [0] => Please enter the vendor's e-mail address.
        )

    [vendor_phone] => Array
        (
            [0] => Please enter the vendor's phone number.
        )

    [RequestHistoryStatus] => Array
        (
            [notes] => Array
                (
                )

        )

)



Any ideas? suggestions? or any more information needed?


Thanks!

-Joel

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.


Reply via email to