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/10/08 21:42:21 UTC

svn commit: r454195 - /incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java

Author: snoopdave
Date: Sun Oct  8 12:42:21 2006
New Revision: 454195

URL: http://svn.apache.org/viewvc?view=rev&rev=454195
Log:
Bug in category name logic

Modified:
    incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java

Modified: incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java?view=diff&rev=454195&r1=454194&r2=454195
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java Sun Oct  8 12:42:21 2006
@@ -91,7 +91,7 @@
     public void saveWeblogCategory(WeblogCategoryData cat) throws RollerException {
         
         if(this.isDuplicateWeblogCategoryName(cat)) {
-            throw new RollerException("Duplicate category name, cannot save new category");
+            throw new RollerException("Duplicate category name, cannot save category");
         }
         
         // update weblog last modified date.  date updated by saveWebsite()
@@ -666,6 +666,7 @@
                 Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
                 Criteria criteria = session.createCriteria(WeblogCategoryAssoc.class);
                 criteria.createAlias("category", "c");
+                criteria.add(Expression.ne("c.id", cat.getId()));
                 criteria.add(Expression.eq("c.name", cat.getName()));
                 criteria.add(Expression.eq("ancestorCategory", parent));
                 criteria.add(Expression.eq("relation", Assoc.PARENT));