On 21 oct, 07:59, "Ma'moon" <[email protected]> wrote:
> You may want to open a ticket @https://trac.cakephp.org/stating the steps
> to reproduce your claims so that the core DEVs may review it and fix it.
That's pretty bad advice - why should cake devs bother filtering
through user-land problems of this nature?
First identify why it's saving twice - there are enough clues in the
OP to guess it has nothing to do with cake at all:
1) Users clicks a link going to /some/url/
2) Due to not-really-using-cake, when the page is loaded there's also
a request for /some/url/js/jquery-1.3.2.min.js
3) The action that both of these urls hits - is saving to the
database.
Rawna - if that's not your problem it's going to be something very
similar. your layout code should include: $javascript->link
('jquery-1.3.2.min.js');
some useful debugging tips/examples:
// anywhere
debug(Debugger::trace());
// in your controller - app controller beforeFilter's a good place
$this->log($this->here);
$this->log($this->referer());
$this->log($this->data);
$this->log($this->params);
// in your model - to find out why 'field' is being saved empty
function beforeSave() {
if (empty($this->data[$this->alias]['field'])) {
debug ($this->data);
debug(Debugger::trace()); die;
}
return true;
}
Other things probably relevant:
use cake [helpers]
get requests shouldn't do anything
http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Safe_methods
if you're using requestAction at all - try not to.
hth,
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
-~----------~----~----~----~------~----~------~--~---