FYI my POST data now looks like this:

Array
(
    [Rental] => Array
        (
            [id] => 1
            [rental_code] => SMpenthouse
            [location_id] => 7
            [rental_agent] => m...@gmail.com
            [rental_meta_title] => 
            [rental_meta_desc] => 
            [rental_meta_tags] => 
            [rental_short_title] => 
            [rental_short_desc] => 
            [rental_title] => Penthouse Apt - 2 Blocks from Beach,
Weekend Specials
            [rental_location] => California living at its best! This
penthouse condo is located in one of the
            [rental_description] => From throughout this very spacious and
sunny penthouse apartment 
            [rental_features] => Two bedrooms, each with private bathroom
            [rental_reviews] =>
http://www.bcvbx.com/guestbook.cfm?pid=122046
            [rental_availability] => 
            [rental_gallery] =>
http://www.hhg.com/ssp_director/images.php?album=14
            [rental_weather] => 90401
            [rental_extra_info] => One time cleaning fee: $90 
            [rental_short_thumb] => Array
                (
                    [name] => 
                    [type] => 
                    [tmp_name] => 
                    [error] => 4
                    [size] => 0
                )

        )

    [Rate] => Array
        (
            [s1_title] => s1 Title
            [s1_day] => 
            [s1_week] => 
            [s1_month] => 
            [s2_title] => 
            [s2_day] => 
            [s2_week] => 
            [s2_month] => 
            [s3_title] => 
            [s3_day] => 
            [s3_week] => 
            [s3_month] => 
            [s4_title] => 
            [s4_day] => 
            [s4_week] => 
            [s4_month] => 
            [extra_info] => 
        )

)


koala kid wrote:
> 
> Thanks, that fixed it. For some reason I had Rate/ instead of Rate. in my
> HTML form as the input name, changing that and its now saving. Thanks for
> the tip.
> 
> However I've now got another issue! When I submit the form the data is
> being saved but I get a PHP warning:
> 
> Warning (2): Illegal offset type in unset [CORE/cake/libs/model/model.php,
> line 561]
> 
> Code | Context
> 
> $params       =       array(
>       "belongsTo" => array(
>       "Location" => array()
> )
> )
> $reset        =       true
> $models       =       array(
>       "Location" => array(
>       "className" => "Location"
> )
> )
> $assoc        =       "belongsTo"
> $model        =       array(
>       "className" => "Location"
> )
> 
>             foreach ($models as $model) {
>                 $this->__backAssociation =
> array_merge($this->__backAssociation, $this->{$assoc});
>                 unset ($this->__backAssociation[$model]);
> 
> Model::unbindModel() - CORE/cake/libs/model/model.php, line 561
> RentalsController::edit() - APP/controllers/rentals_controller.php, line
> 91
> Object::dispatchMethod() - CORE/cake/libs/object.php, line 116
> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 227
> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194
> [main] - APP/webroot/index.php, line 88 
> 
> 
> It looks like I still haven't got my head around this ORM thing. Have I
> set up my associations correctly?
> 
> Thanks for your help.
> 
> 
> 
> 
> John Andersen-6 wrote:
>> 
>> Yes, your data is not CakePHP compatible. The Rental looks find, but
>> it also includes the Rate.
>> The Rate should be at the same level as Rental, and should look like
>> this:
>> 
>> [Rate] => Array
>>    (
>>       [0] => Array
>>          (
>>             [title] => 1
>>             [day] =>
>> ...
>>          )
>>       [1] => Array
>>          (
>> and so on.
>> 
>> You probably have to modify your view or the file that you use to
>> create the view, so that it returns the above structure.
>> Enjoy,
>>    John
>> 
>> On Jan 15, 1:41 am, koala kid <a...@koalawebsolutions.com> wrote:
>>> Thanks for your input. It looks like below. I think I may have the Model
>>> name
>>> in the wrong place?? I'm using: echo $form->create('Rental',
>>> array('type' =>
>>> 'file', 'action' => 'edit'));  to create the form.
>>>
>>> Array
>>> (
>>>     [Rental] => Array
>>>         (
>>>             [id] => 60
>>>             [rental_code] => code
>>>             [location_id] => 37
>>>             [rental_agent] => a...@gmail.com
>>>             [rental_meta_title] => meta title
>>>             [rental_meta_desc] => meta desc
>>>             [rental_meta_tags] => meta kewords
>>>             [rental_short_title] => location title
>>>             [rental_short_desc] => location desc
>>>             [rental_title] => prop title
>>>             [rental_location] => prop location desc
>>>             [rental_description] => prop desc
>>>             [rental_features] => feature list
>>>             [rental_reviews] => review link
>>>             [rental_availability] => availability link
>>>             [rental_gallery] => slideshow link
>>>             [rental_weather] => weather widget
>>>             [rental_extra_info] => extra info
>>>             [Rate/s1_title] => 1
>>>             [Rate/s1_day] =>
>>>             [Rate/s1_week] =>
>>>             [Rate/s1_month] =>
>>>             [Rate/s2_title] =>
>>>             [Rate/s2_day] =>
>>>             [Rate/s2_week] =>
>>>             [Rate/s2_month] =>
>>>             [Rate/s3_title] =>
>>>             [Rate/s3_day] =>
>>>             [Rate/s3_week] =>
>>>             [Rate/s3_month] =>
>>>             [Rate/s4_title] =>
>>>             [Rate/s4_day] =>
>>>             [Rate/s4_week] =>
>>>             [Rate/s4_month] =>
>>>             [Rate/extra_info] =>
>>>             [rental_short_thumb] => holder.gif
>>>         )
>>>
>>> )
>>>
>>>
>>>
>>> John Andersen-6 wrote:
>>>
>>> > How does your data look like before the saveAll statement?
>>> > Enjoy,
>>> >    John
>> [snip]
>> 
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>> 
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php?hl=en
>> 
>> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Unable-to-save-related-table-information-tp27153345p27182576.html
Sent from the CakePHP mailing list archive at Nabble.com.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to