Author: jwage
Date: 2008-09-08 20:09:22 +0100 (Mon, 08 Sep 2008)
New Revision: 4886

Modified:
   branches/1.0/lib/Doctrine/Connection/UnitOfWork.php
Log:
fixes #1431


Modified: branches/1.0/lib/Doctrine/Connection/UnitOfWork.php
===================================================================
--- branches/1.0/lib/Doctrine/Connection/UnitOfWork.php 2008-09-08 19:00:21 UTC 
(rev 4885)
+++ branches/1.0/lib/Doctrine/Connection/UnitOfWork.php 2008-09-08 19:09:22 UTC 
(rev 4886)
@@ -390,13 +390,15 @@
                 if ($obj instanceof Doctrine_Record && $obj->isModified()) {
                     $obj->save($this->conn);
 
-                    /** Can this be removed?
                     $id = array_values($obj->identifier());
 
-                    foreach ((array) $rel->getLocal() as $k => $field) {
-                        $record->set($field, $id[$k]);
+                    if ( ! empty($id)) {
+                        foreach ((array) $rel->getLocal() as $k => $field) {
+                            if (isset($id[$k]) && $id[$k]) {
+                                $record->set($field, $id[$k]);
+                            }
+                        }
                     }
-                    */
                 }
             }
         }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" 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.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to