On Thu, Mar 17, 2011 at 10:42 AM, Warren <[email protected]> wrote:
> I think you have to reset the active record in your for each loop, try this
> :
>
> foreach ($ids as $id) {
>                $this->Item->id = $id;
>                $this->Item->saveField('sort_order', $i++);
>                $this->Item->create();
>            }

You're right. Missed that. Although the line with create() should come
first, then set the id, etc.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to