You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2006/03/23 16:46:32 UTC

svn commit: r388194 - /incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java

Author: snoopdave
Date: Thu Mar 23 07:46:30 2006
New Revision: 388194

URL: http://svn.apache.org/viewcvs?rev=388194&view=rev
Log:
Fix for the Hibernate transient object error message, ROL-970

Modified:
    incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java

Modified: incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java?rev=388194&r1=388193&r2=388194&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java Thu Mar 23 07:46:30 2006
@@ -397,7 +397,9 @@
     }
     
     public int getCommentCount() {
-        List comments = weblogEntry.getComments(false, false);
+        // Don't check for comments on unsaved entry (fixed ROL-970)
+        if (weblogEntry.getId() == null) return 0;
+        List comments = comments = weblogEntry.getComments(false, false);
         return comments != null ? comments.size() : 0;
     }
 }