Update of /var/cvs/src/org/mmbase/datatypes/processors
In directory james.mmbase.org:/tmp/cvs-serv29812

Modified Files:
        Related.java 
Log Message:
made it work on new nodes too


See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/datatypes/processors


Index: Related.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/datatypes/processors/Related.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- Related.java        11 Nov 2008 18:34:21 -0000      1.4
+++ Related.java        30 Dec 2008 12:39:25 -0000      1.5
@@ -23,7 +23,7 @@
  *
  * @author Michiel Meeuwissen
  * @since MMBase-1.8.7
- * @version $Id: Related.java,v 1.4 2008/11/11 18:34:21 michiel Exp $
+ * @version $Id: Related.java,v 1.5 2008/12/30 12:39:25 michiel Exp $
  */
 
 public class Related {
@@ -68,6 +68,7 @@
                     RelationManager rel = 
cloud.getRelationManager(node.getNodeManager(),
                                                                    
cloud.getNodeManager(type),
                                                                role);
+                    if (node.isNew()) node.commit(); // Silly, but you cannot 
make relations to new nodes.
                     Relation newrel = node.createRelation(dest, rel);
                     newrel.commit();
                 }
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to