Hi,
I had to ask here before posting an unnecessary ticket.

In 1.2 RC3, Model::del() will delete all records in the table of an
associated model under these circumstances:
• dependent is set to true
• conditions is a string (as in the docs) and not an array as is the
new preferred way to write conditions for find().

var $hasOne = array(
    'Profile' => array(
        'className' => 'Profile',
        'foreignKey'    => 'foreign_id',
        'conditions'    => array('Profile.belongs_to = \'Client\''),
        'dependent' => true
    )
);

Will delete anything in the profiles table (WHERE 1=1), so the
definition must now be:

var $hasOne = array(
    'Profile' => array(
        'className' => 'Profile',
        'foreignKey'    => 'foreign_id',
        'conditions'    => array('Profile.belongs_to' => 'Client'),
        'dependent' => true
    )
);


If this is a bug it should have been caught already so i suspect it is
an intended change to the API. But if is is a change in the API and
the results from not noticing this change is the deletion of ALL
records in a table I would also have expected to have heard about it
already.

model.php line 1595 uses array_merge() when in RC2 am() is used. am()
converts strings to arrays internally whenever needed.

So are all string-conditions now universally incompatible?

/Martin
--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to