CakePHP HATBM related daya do not get saved
===

I think I did everything by the book.

I have an Organization Model and a Language model. I have created a languages_organizations table containing just three fields id, language_id and organization_id.

Next I have defined hasandBelongsToMany relationship in my Organizations model, using just the 

    var $hasAndBelongsToMany = array(
        'Language'
    );

My Organization edit view contains code like this

                echo $this->Form->create('Organization');
                ...
                echo $this->Form->input(
                    'Language',
                    array(
                        'label' => __('Enabled languages', TRUE)
                    )
                ); 
                ...
                echo $this->Form->end();      

This produces a multi select input that allows the user to select which languages should be enabled for every organization.

My problem with this setup that is that when data get posted back by the edit page, all existing records get deleted but no new ones get inserted. 

My controller code -- baked with the cake bake script is like this:

        if (!empty($this->data)) {
            if ($this->Organization->save($this->data)) {
                $this->Session->setFlash(
                    __('The organization has been saved', TRUE),
                    'flash_success'
                );

                $this->redirect( array('action' => 'index'));
	} 


When I try to insert data manual from sql using a query like 

    INSERT INTO `languages_organizations` (
        `id` ,
        `language_id` ,
        `organization_id`
    ) VALUES (
        NULL , 'en', '1'
    ), (
        NULL , 'de', '1'
    );

Then the select boxes display the correct data, but when they get posted back, then everything is lost. The cake manual says

> By default when saving a HasAndBelongsToMany relationship, Cake will delete all rows on the > join table before saving new ones. For example if you have a Club that has 10 Children 
> associated. You then update the Club with 2 children. The Club will only have 2 Children, 
> not 12

So my guess is that save() correctly deletes all records from the languages_organizations table but something prevents it from adding new ones.

Both the cake error and debug logs show absolutely nothing during post and that is also true for the mysql error log on the database server.

Please help me figure out how to debug this.

