roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r494605 - /incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/CategorySaveAction.java
Date Tue, 09 Jan 2007 21:44:30 GMT
Author: agilliland
Date: Tue Jan  9 13:44:30 2007
New Revision: 494605

URL: http://svn.apache.org/viewvc?view=rev&rev=494605
Log:
fixing bug where categories couldn't be modified.


Modified:
    incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/CategorySaveAction.java

Modified: incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/CategorySaveAction.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/CategorySaveAction.java?view=diff&rev=494605&r1=494604&r2=494605
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/CategorySaveAction.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/ui/authoring/struts/actions/CategorySaveAction.java
Tue Jan  9 13:44:30 2007
@@ -64,6 +64,22 @@
         WeblogCategoryData cd = null;
         if (null != form.getId() && !form.getId().trim().equals("")) {
             cd = wmgr.getWeblogCategory(form.getId());
+            
+            // update changeable properties
+            if(!cd.getName().equals(form.getName())) {
+                cd.setName(form.getName());
+                
+                // path includes name, so update path as well
+                WeblogCategoryData parent = cd.getParent();
+                if("/".equals(parent.getPath())) {
+                    cd.setPath("/"+cd.getName());
+                } else {
+                    cd.setPath(parent.getPath() + "/" + cd.getName());
+                }
+            }
+            cd.setDescription(form.getDescription());
+            cd.setImage(form.getImage());
+            
         } else {
             WeblogCategoryData parentCat = wmgr.getWeblogCategory(form.getParentId());
             cd = new WeblogCategoryData(



Mime
View raw message