Almost certainly, if you check the ids of your categories, the problem
is not that a category is being deleted it's that it's that an existing
category is being overwritten with the details for a new category.

The long and the short of it is that if the field "id" is set on a
model when you call save it makes an update, and if it's not set it
makes an insert.

If this describes your prob call $this->Category->create(); before
saving your new instance.

HTH,

Please note:
The manual/bakery is a good place to start any quest for info.
The cake search (at the time of writing) erroneously reports less/no
results for the google group.
The wiki may contain incorrect info - read at your own risk (it's
mainly user submitted) :)
You may get your answer quicker by asking on the IRC Channel (you can
access it with just a browser here: http://irc.cakephp.org).
On Nov 3, 10:43 pm, "PD" <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> I have built the site on cakePHP. It was really a great experience. I a
> having this very strange but extremely critical bug in it.
>
> Here is the structure.
> Categories hasMany subCategories hasMany Products... simple right?
>
> Now I have built my category/subcategory management page using ajax
> helper.
>
> What happens 'some random times' is that while I am adding a category
> or updating a categry, some of the categories gets deleted
> misteriously. I am not able to track down the cause of the problem. Did
> anyone have any such problem? Do you have any recommendations on how to
> go about debuggin this one. I have tried a lot, but as I said, as it
> only happens 'some random times', I am just not able to reproduce it
> upon wish.
>
> Thanks in advance. I would really appreciate any bit of help on this
> one.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" 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