From: Chris W. <ch...@cw...> - 2001-11-26 16:25:52
|
* Ray Zimmerman (rz...@co...) [011126 10:53]: > Chris, > > It looks like there's been a change in the behavior of clone from > 0.52 to 0.53. Previously it was possible to do ... > > $obj1 = MyClass->fetch($id); > $obj2 = $obj1->clone; > $obj2->save; > > ... with no problems since the call to clone would set the id to > undef in the clone. With SPOPS-0.53, the id is copied as well so the > save attempts an insert and fails with duplicate key problems. > > Bug or feature? Bug -- I tried to mix multifield checks in there and failed. The previous behavior has been restored in CVS, and an updated version will be out shortly. The tests didn't catch this because they don't use auto-generated keys. I might fix this in the future, but that's fairly low on my list. (It would probably come with porting the SQLInstall stuff from OpenInteract to SPOPS...) Thanks much for the clear report. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |