>
> Hi all,
>
> I've run into the strangest problem, and have no idea where to start
> looking: I've got an community platform website, where members
> (sometimes only admins) can post content. Somehow, about once a day on
> different times and without other content being posted at the same
> time, empty records appear in my database. As far as I know, this
> shouldn't be possible:
Do you have access to the DB config? If so, set it to log all
inserts/updates (don't forget to change it back for production unless
you want that).
> - all models have pretty tight validation rules that should prevent
> this kind of behaviour
> - all add/edit methods are protected by ACL, so only users can add/
> edit. Some of them are even admin-only accessible
> - every save action fills the user_id field just before saving, but
> the user_id for the empty records is 0 (zero)
>
> Since the user_id isn't saved, I guess creation of the new record
> doesn't happen through the add/edit methods in the controller. That
> might also explain why validation rules are ignored.
>
> As I said, don't know where to start looking. This must be triggered
> by some kind of user action, but how, why and where is a huge problem
> to find out. Anyone?
How do you get the User.id? From $this->Auth->user() or somewhere in
$this->data?
How many tables does this affect? If just one, it should be easy
enough to narrow down which actions are responsible. Put some
$this->log() calls in there.
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment