Hi AD,

It's the Searchable Behaviour from here:

http://code.google.com/p/searchable-behaviour-for-cakephp/source/browse/trunk/models/behaviors/searchable.php

You can see on line 27 it uses the id field from the data.

If that's the official guidance (that behaviours should look at Model-
>id instead of $data[model][id]) then that's fine, I'll do as you
suggest and modify this behaviour to use Model->id. Maybe that's
something for the documentation?

I just thought it was strange that something as important as the id
field of the data would be fiddled with!

J




On Oct 13, 8:30 pm, AD7six <[EMAIL PROTECTED]> wrote:
> On Oct 11, 1:06 am, acoustic_overdrive <[EMAIL PROTECTED]>
> wrote:
>
> > I'm trying to use the TreeBehaviour at the same time as other
> > behaviours and I've noticed that after the TreeBehaviour gets hold of
> > the data array during a save operation, the "id" field in the Data is
> > missing, which is causing my other behaviour a bit of a problem.
>
> What other behaviors
>
> > I can see from the TreeBehaviour's source that it unsets this value on
> > line 148 in its beforeSave function:
>
> > unset($model->data[$model->alias][$model->primaryKey]);
>
> which it does after setting $model->id
>
> If it is causing a problem, please create a test case and ticket it,
> but I'd suggest it's probably a failing in the other behavior(s) to
> rely on $data and ignore $model->id
>
> AD
--~--~---------~--~----~------------~-------~--~----~
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