From 4aa8959b094865524405e2f65507c38965bb21b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Thu, 1 Sep 2011 10:55:06 +0200
Subject: [PATCH] Publish document late, after reference is known.

---
 bt5/erp5_web_shadir/ExtensionTemplateItem/ShaDir.py | 2 +-
 bt5/erp5_web_shadir/bt/revision                     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bt5/erp5_web_shadir/ExtensionTemplateItem/ShaDir.py b/bt5/erp5_web_shadir/ExtensionTemplateItem/ShaDir.py
index 212b124ba9..3207c077bd 100644
--- a/bt5/erp5_web_shadir/ExtensionTemplateItem/ShaDir.py
+++ b/bt5/erp5_web_shadir/ExtensionTemplateItem/ShaDir.py
@@ -103,6 +103,7 @@ def WebSection_setObject(self, id, ob, **kw):
   ob.setReference(reference)
   if expiration_date is not None:
     ob.setExpirationDate(expiration_date)
+  ob.publish()
   return ob
 
 def WebSection_putFactory(self, name, typ, body):
@@ -119,6 +120,5 @@ def WebSection_putFactory(self, name, typ, body):
   document = portal.portal_contributions.newContent(data=body,
                                                     filename=name,
                                                     discover_metadata=False)
-  document.publish()
   return document
 
diff --git a/bt5/erp5_web_shadir/bt/revision b/bt5/erp5_web_shadir/bt/revision
index 4b6f9c39e5..b44fe09a7a 100644
--- a/bt5/erp5_web_shadir/bt/revision
+++ b/bt5/erp5_web_shadir/bt/revision
@@ -1 +1 @@
-64
\ No newline at end of file
+65
\ No newline at end of file
-- 
2.30.9