On Dec 18, 12:44 pm, gearvOsh <[email protected]> wrote:
> Like I said, I dont want to Import the locale in every model method.

Hint: you don't need to, and it doesn't say you should.

>
> Also saveField fails at this point:
>
> if (!empty($this->id)) {
>         if (!$db->update($this, $fields, $values)) {
>                 $success = false;
>         }
>
> }
>
> Because of this, When I know for sure the row exists.
>
> if (!$this->__exists && $count > 0) {
>         $this->id = false;
>
> }
>
> Which fails because it runs this query:
>
> SELECT COUNT(*) AS `count` FROM `users` AS `User` WHERE `User`.`id` =
> 'eac20adf536b50f9fc0be58550fde763'

That either means you're looking at a wrong/irrelevant sql statement
or you are not calling create as you said above
https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/model/model.php#L968
>
> Because for some reason the id is being pulled from the controller
> action argument, which makes no god damn sense.

That's the problem of showing a 'window' view of your code instead of
the method in its enirety.

The following code snippet would generate an update:

$this->User->create();
$this->User->id = $this->User->field('id'); // find a random user
$this->User->saveField('field', 'value');
die;

irrespective of where you put it - try based on that example.

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