Author: michiel
Date: 2009-05-29 15:32:01 +0200 (Fri, 29 May 2009)
New Revision: 35514
Modified:
mmbase/trunk/src/org/mmbase/datatypes/processors/RelatedField.java
Log:
if new but real number don't commit either
Modified: mmbase/trunk/src/org/mmbase/datatypes/processors/RelatedField.java
===================================================================
--- mmbase/trunk/src/org/mmbase/datatypes/processors/RelatedField.java
2009-05-29 13:31:32 UTC (rev 35513)
+++ mmbase/trunk/src/org/mmbase/datatypes/processors/RelatedField.java
2009-05-29 13:32:01 UTC (rev 35514)
@@ -60,8 +60,10 @@
NodeList rl = related.getNodeManager().getList(related);
if (rl.size() == 0) {
log.service("No related node of type " + getRelatedType(node)
+ ". Implicitely creating now.");
- if (node.isNew()) node.commit(); // Silly, but you cannot make
relations to new
- // nodes.
+ if (node.isNew() && node.getNumber() < 0) {
+ node.commit(); // Silly, but you cannot make relations to
new nodes.
+
+ }
Cloud cloud = node.getCloud();
Node newNode = getRelatedType(node).createNode();
newNode.commit();
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs