Re: saveField breaks in new 1.2 release

2007-10-25 Thread LW

I found out:
Pretty trivial in the end, but hey, it's always, isn't it?

The saveField triggered a beforeSave-Function which then returned
false, because it was designed for uploading and saving images and
couldn't handle the data. Strange thing is, it didn't in the alpha-
release but i couldn't find anything in the changeset.

Is there a way to disable beforeFilters from the controller-
functions?

Thanks for all the help in the course of this,
Lutz

On 24 Okt., 18:20, francky06l <[EMAIL PROTECTED]> wrote:
> you could try in the loop :
> $this->Image->set(array('id' => $ids, 'sort' => $i));
> $this->Image->save();
>
> And turn the Debug to 2 to check the SQL generated. You might also
> have to turn off the cacheQueries (not sure it interferes in this
> context).
>
> On Oct 24, 5:45 pm, LW <[EMAIL PROTECTED]> wrote:
>
> > Hi Wayne,
>
> > if i do a debug($ids) it shows:
> > Array
> > (
> > [0] => 134
> > [1] => 140
> > [2] => 141
> > [3] => 139
> > )
> > which are the id's of the entries in the image-table.
> > looks ok to me, that's what should be in there.
>
> > also from the echo statements in the foreach-loop i can see the
> > saveField gets called but returns false.
>
> > I don't get it, any thoughts?
>
> > Lutz
>
> > On 24 Okt., 17:28, "Wayne Fay" <[EMAIL PROTECTED]> wrote:
>
> > > Looks like you're only getting a SELECT executed. Are you sure the
> > > $ids variable has proper values in it -- if not, the foreach() won't
> > > run and saveField() will never get called.
>
> > > Add some debugging statements to your code and check the debug log
> > > after executing this method a few times.
>
> > > Wayne
>
> > > On 10/24/07, LW <[EMAIL PROTECTED]> wrote:
>
> > > > Well, I don't doubt that saveFields works in 1.2
> > > > I just don't get why it's not working in my code after the update and
> > > > i thought maybe something changed in the way saveField is used or
> > > > something like that. I'd appreciate any help on this, what code do you
> > > > need to see?
>
> > > > Maybe the response i get might help:
>
> > > >  > > > id="cakeSqlLog_1193212061471ef89d060722_06944581" summary="Cake SQL
> > > > Log" cellspacing="0" border = "0">
> > > > 1 query took 0 ms
> > > > 
> > > > NrQueryErrorAffectedNum.
> > > > rowsTook (ms)
> > > > 
> > > > 
> > > > 1SELECT COUNT(*) AS `count` FROM `images` AS
> > > > `Image`   WHERE `Image`.`id`  =  134 11 > > > "text-align: right">0
> > > > 
> > > > 
>
> > > > thanks,
> > > > Lutz
>
> > > > On 24 Okt., 00:53, "Mariano Iglesias" <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > I suggest you post your code, since Model has an awesome test 
> > > > > coverage: in
> > > > > cake/tests/cases/libs/model/model.test.php you can see for example the
> > > > > function testSaveField() which tests for saveField() calls, and all 
> > > > > tests
> > > > > are succeeding. Therefore saveField() IS WORKING on 1.2.
>
> > > > > -MI
>
> > > > > ---
>
> > > > > Remember, smart coders answer ten questions for every question they 
> > > > > ask.
> > > > > So be smart, be cool, and share your knowledge.
>
> > > > > BAKE ON!
>
> > > > > blog:http://www.MarianoIglesias.com.ar
>
> > > > > -Mensaje original-
> > > > > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
> > > > > de LW
> > > > > Enviado el: Martes, 23 de Octubre de 2007 04:34 p.m.
> > > > > Para: Cake PHP
> > > > > Asunto: Re: saveField breaks in new 1.2 release
>
> > > > > Doesn't work means the db-records are not updated, the saveField data
> > > > > is not saved. it doesn't give me an error message or any entry in the
> > > > > cake debug log though.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: saveField breaks in new 1.2 release

2007-10-24 Thread francky06l

you could try in the loop :
$this->Image->set(array('id' => $ids, 'sort' => $i));
$this->Image->save();

And turn the Debug to 2 to check the SQL generated. You might also
have to turn off the cacheQueries (not sure it interferes in this
context).

On Oct 24, 5:45 pm, LW <[EMAIL PROTECTED]> wrote:
> Hi Wayne,
>
> if i do a debug($ids) it shows:
> Array
> (
> [0] => 134
> [1] => 140
> [2] => 141
> [3] => 139
> )
> which are the id's of the entries in the image-table.
> looks ok to me, that's what should be in there.
>
> also from the echo statements in the foreach-loop i can see the
> saveField gets called but returns false.
>
> I don't get it, any thoughts?
>
> Lutz
>
> On 24 Okt., 17:28, "Wayne Fay" <[EMAIL PROTECTED]> wrote:
>
> > Looks like you're only getting a SELECT executed. Are you sure the
> > $ids variable has proper values in it -- if not, the foreach() won't
> > run and saveField() will never get called.
>
> > Add some debugging statements to your code and check the debug log
> > after executing this method a few times.
>
> > Wayne
>
> > On 10/24/07, LW <[EMAIL PROTECTED]> wrote:
>
> > > Well, I don't doubt that saveFields works in 1.2
> > > I just don't get why it's not working in my code after the update and
> > > i thought maybe something changed in the way saveField is used or
> > > something like that. I'd appreciate any help on this, what code do you
> > > need to see?
>
> > > Maybe the response i get might help:
>
> > >  > > id="cakeSqlLog_1193212061471ef89d060722_06944581" summary="Cake SQL
> > > Log" cellspacing="0" border = "0">
> > > 1 query took 0 ms
> > > 
> > > NrQueryErrorAffectedNum.
> > > rowsTook (ms)
> > > 
> > > 
> > > 1SELECT COUNT(*) AS `count` FROM `images` AS
> > > `Image`   WHERE `Image`.`id`  =  134 11 > > "text-align: right">0
> > > 
> > > 
>
> > > thanks,
> > > Lutz
>
> > > On 24 Okt., 00:53, "Mariano Iglesias" <[EMAIL PROTECTED]>
> > > wrote:
> > > > I suggest you post your code, since Model has an awesome test coverage: 
> > > > in
> > > > cake/tests/cases/libs/model/model.test.php you can see for example the
> > > > function testSaveField() which tests for saveField() calls, and all 
> > > > tests
> > > > are succeeding. Therefore saveField() IS WORKING on 1.2.
>
> > > > -MI
>
> > > > ---
>
> > > > Remember, smart coders answer ten questions for every question they ask.
> > > > So be smart, be cool, and share your knowledge.
>
> > > > BAKE ON!
>
> > > > blog:http://www.MarianoIglesias.com.ar
>
> > > > -Mensaje original-
> > > > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
> > > > de LW
> > > > Enviado el: Martes, 23 de Octubre de 2007 04:34 p.m.
> > > > Para: Cake PHP
> > > > Asunto: Re: saveField breaks in new 1.2 release
>
> > > > Doesn't work means the db-records are not updated, the saveField data
> > > > is not saved. it doesn't give me an error message or any entry in the
> > > > cake debug log though.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: saveField breaks in new 1.2 release

2007-10-24 Thread LW

Hi,
I still don't know what this is ...

How could i see what happens with the saveField ?
right now i just know that the saveField command fails, i'm using an
if-clause to get a response:

function order_images(){
$this->autoRender = false;
$ids= $this->params['form']['imgList'];
$i = 1;
foreach($ids as $id){
$this->Image->id = $id;
if($this->Image->saveField('sort', $i)){
echo 'ok - '.$id;
}else{
echo 'not ok - '.$id;
}
$i++;
}
}
It gives me an 'not ok - ...' for every $id in the array.
what is the next step i could take in finding the error?

thanks,
Lutz

On 24 Okt., 09:52, LW <[EMAIL PROTECTED]> wrote:
> Well, I don't doubt that saveFields works in 1.2
> I just don't get why it's not working in my code after the update and
> i thought maybe something changed in the way saveField is used or
> something like that. I'd appreciate any help on this, what code do you
> need to see?
>
> Maybe the response i get might help:
>
>  id="cakeSqlLog_1193212061471ef89d060722_06944581" summary="Cake SQL
> Log" cellspacing="0" border = "0">
> 1 query took 0 ms
> 
> NrQueryErrorAffectedNum.
> rowsTook (ms)
> 
> 
> 1SELECT COUNT(*) AS `count` FROM `images` AS
> `Image`   WHERE `Image`.`id`  =  134 11 "text-align: right">0
> 
> 
>
> thanks,
> Lutz
>
> On 24 Okt., 00:53, "Mariano Iglesias" <[EMAIL PROTECTED]>
> wrote:
>
> > I suggest you post your code, since Model has an awesome test coverage: in
> > cake/tests/cases/libs/model/model.test.php you can see for example the
> > function testSaveField() which tests for saveField() calls, and all tests
> > are succeeding. Therefore saveField() IS WORKING on 1.2.
>
> > -MI
>
> > ---
>
> > Remember, smart coders answer ten questions for every question they ask.
> > So be smart, be cool, and share your knowledge.
>
> > BAKE ON!
>
> > blog:http://www.MarianoIglesias.com.ar
>
> > -Mensaje original-
> > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
> > de LW
> > Enviado el: Martes, 23 de Octubre de 2007 04:34 p.m.
> > Para: Cake PHP
> > Asunto: Re: saveField breaks in new 1.2 release
>
> > Doesn't work means the db-records are not updated, the saveField data
> > is not saved. it doesn't give me an error message or any entry in the
> > cake debug log though.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: saveField breaks in new 1.2 release

2007-10-24 Thread LW

Hi Wayne,

if i do a debug($ids) it shows:
Array
(
[0] => 134
[1] => 140
[2] => 141
[3] => 139
)
which are the id's of the entries in the image-table.
looks ok to me, that's what should be in there.

also from the echo statements in the foreach-loop i can see the
saveField gets called but returns false.

I don't get it, any thoughts?

Lutz

On 24 Okt., 17:28, "Wayne Fay" <[EMAIL PROTECTED]> wrote:
> Looks like you're only getting a SELECT executed. Are you sure the
> $ids variable has proper values in it -- if not, the foreach() won't
> run and saveField() will never get called.
>
> Add some debugging statements to your code and check the debug log
> after executing this method a few times.
>
> Wayne
>
> On 10/24/07, LW <[EMAIL PROTECTED]> wrote:
>
>
>
> > Well, I don't doubt that saveFields works in 1.2
> > I just don't get why it's not working in my code after the update and
> > i thought maybe something changed in the way saveField is used or
> > something like that. I'd appreciate any help on this, what code do you
> > need to see?
>
> > Maybe the response i get might help:
>
> >  > id="cakeSqlLog_1193212061471ef89d060722_06944581" summary="Cake SQL
> > Log" cellspacing="0" border = "0">
> > 1 query took 0 ms
> > 
> > NrQueryErrorAffectedNum.
> > rowsTook (ms)
> > 
> > 
> > 1SELECT COUNT(*) AS `count` FROM `images` AS
> > `Image`   WHERE `Image`.`id`  =  134 11 > "text-align: right">0
> > 
> > 
>
> > thanks,
> > Lutz
>
> > On 24 Okt., 00:53, "Mariano Iglesias" <[EMAIL PROTECTED]>
> > wrote:
> > > I suggest you post your code, since Model has an awesome test coverage: in
> > > cake/tests/cases/libs/model/model.test.php you can see for example the
> > > function testSaveField() which tests for saveField() calls, and all tests
> > > are succeeding. Therefore saveField() IS WORKING on 1.2.
>
> > > -MI
>
> > > ---
>
> > > Remember, smart coders answer ten questions for every question they ask.
> > > So be smart, be cool, and share your knowledge.
>
> > > BAKE ON!
>
> > > blog:http://www.MarianoIglesias.com.ar
>
> > > -Mensaje original-
> > > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
> > > de LW
> > > Enviado el: Martes, 23 de Octubre de 2007 04:34 p.m.
> > > Para: Cake PHP
> > > Asunto: Re: saveField breaks in new 1.2 release
>
> > > Doesn't work means the db-records are not updated, the saveField data
> > > is not saved. it doesn't give me an error message or any entry in the
> > > cake debug log though.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: saveField breaks in new 1.2 release

2007-10-24 Thread Wayne Fay

Looks like you're only getting a SELECT executed. Are you sure the
$ids variable has proper values in it -- if not, the foreach() won't
run and saveField() will never get called.

Add some debugging statements to your code and check the debug log
after executing this method a few times.

Wayne

On 10/24/07, LW <[EMAIL PROTECTED]> wrote:
>
> Well, I don't doubt that saveFields works in 1.2
> I just don't get why it's not working in my code after the update and
> i thought maybe something changed in the way saveField is used or
> something like that. I'd appreciate any help on this, what code do you
> need to see?
>
> Maybe the response i get might help:
>
>  id="cakeSqlLog_1193212061471ef89d060722_06944581" summary="Cake SQL
> Log" cellspacing="0" border = "0">
> 1 query took 0 ms
> 
> NrQueryErrorAffectedNum.
> rowsTook (ms)
> 
> 
> 1SELECT COUNT(*) AS `count` FROM `images` AS
> `Image`   WHERE `Image`.`id`  =  134 11 "text-align: right">0
> 
> 
>
> thanks,
> Lutz
>
>
> On 24 Okt., 00:53, "Mariano Iglesias" <[EMAIL PROTECTED]>
> wrote:
> > I suggest you post your code, since Model has an awesome test coverage: in
> > cake/tests/cases/libs/model/model.test.php you can see for example the
> > function testSaveField() which tests for saveField() calls, and all tests
> > are succeeding. Therefore saveField() IS WORKING on 1.2.
> >
> > -MI
> >
> > ---
> >
> > Remember, smart coders answer ten questions for every question they ask.
> > So be smart, be cool, and share your knowledge.
> >
> > BAKE ON!
> >
> > blog:http://www.MarianoIglesias.com.ar
> >
> > -Mensaje original-
> > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
> > de LW
> > Enviado el: Martes, 23 de Octubre de 2007 04:34 p.m.
> > Para: Cake PHP
> > Asunto: Re: saveField breaks in new 1.2 release
> >
> > Doesn't work means the db-records are not updated, the saveField data
> > is not saved. it doesn't give me an error message or any entry in the
> > cake debug log though.
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: saveField breaks in new 1.2 release

2007-10-24 Thread LW

Well, I don't doubt that saveFields works in 1.2
I just don't get why it's not working in my code after the update and
i thought maybe something changed in the way saveField is used or
something like that. I'd appreciate any help on this, what code do you
need to see?

Maybe the response i get might help:


1 query took 0 ms

NrQueryErrorAffectedNum.
rowsTook (ms)


1SELECT COUNT(*) AS `count` FROM `images` AS
`Image`   WHERE `Image`.`id`  =  134 110



thanks,
Lutz


On 24 Okt., 00:53, "Mariano Iglesias" <[EMAIL PROTECTED]>
wrote:
> I suggest you post your code, since Model has an awesome test coverage: in
> cake/tests/cases/libs/model/model.test.php you can see for example the
> function testSaveField() which tests for saveField() calls, and all tests
> are succeeding. Therefore saveField() IS WORKING on 1.2.
>
> -MI
>
> ---
>
> Remember, smart coders answer ten questions for every question they ask.
> So be smart, be cool, and share your knowledge.
>
> BAKE ON!
>
> blog:http://www.MarianoIglesias.com.ar
>
> -Mensaje original-
> De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
> de LW
> Enviado el: Martes, 23 de Octubre de 2007 04:34 p.m.
> Para: Cake PHP
> Asunto: Re: saveField breaks in new 1.2 release
>
> Doesn't work means the db-records are not updated, the saveField data
> is not saved. it doesn't give me an error message or any entry in the
> cake debug log though.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



RE: saveField breaks in new 1.2 release

2007-10-23 Thread Mariano Iglesias

I suggest you post your code, since Model has an awesome test coverage: in
cake/tests/cases/libs/model/model.test.php you can see for example the
function testSaveField() which tests for saveField() calls, and all tests
are succeeding. Therefore saveField() IS WORKING on 1.2.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de LW
Enviado el: Martes, 23 de Octubre de 2007 04:34 p.m.
Para: Cake PHP
Asunto: Re: saveField breaks in new 1.2 release

Doesn't work means the db-records are not updated, the saveField data
is not saved. it doesn't give me an error message or any entry in the
cake debug log though.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: saveField breaks in new 1.2 release

2007-10-23 Thread LW

Doesn't work means the db-records are not updated, the saveField data
is not saved. it doesn't give me an error message or any entry in the
cake debug log though.



On 23 Okt., 18:40, "Wayne Fay" <[EMAIL PROTECTED]> wrote:
> What does "doesn't work" mean, can you be more specific? And can you
> provide the stack trace or some debug log?
>
> Wayne
>
> On 10/23/07, LW <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
> > i just updated to the new release (of 1.2) and I'm having one problem
> > I can't resolve:
>
> > I'm updating my db from a sortable list through this function:
>
> > function order_images(){
> >  $ids= $this->params['form']['imgList'];
> >  $i = 1;
> >  foreach($ids as $id){
> >$this->Image->id = $id;
> >$this->Image->saveField('sort', $i++);
> >  }
> >$this->autoRender = false;
> >}
>
> > It used to work fine befre the update, now it doesn't.
>
> > any ideas?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: saveField breaks in new 1.2 release

2007-10-23 Thread Wayne Fay

What does "doesn't work" mean, can you be more specific? And can you
provide the stack trace or some debug log?

Wayne

On 10/23/07, LW <[EMAIL PROTECTED]> wrote:
>
> Hi,
> i just updated to the new release (of 1.2) and I'm having one problem
> I can't resolve:
>
> I'm updating my db from a sortable list through this function:
>
> function order_images(){
> $ids= $this->params['form']['imgList'];
> $i = 1;
> foreach($ids as $id){
>   $this->Image->id = $id;
>   $this->Image->saveField('sort', $i++);
> }
>   $this->autoRender = false;
>   }
>
> It used to work fine befre the update, now it doesn't.
>
> any ideas?
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



saveField breaks in new 1.2 release

2007-10-23 Thread LW

Hi,
i just updated to the new release (of 1.2) and I'm having one problem
I can't resolve:

I'm updating my db from a sortable list through this function:

function order_images(){
  $ids= $this->params['form']['imgList'];
  $i = 1;
  foreach($ids as $id){
$this->Image->id = $id;
$this->Image->saveField('sort', $i++);
  }
$this->autoRender = false;
}

It used to work fine befre the update, now it doesn't.

any ideas?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---