svn commit: r509955 - in /ofbiz/trunk/applications: ecommerce/webapp/ecommerce/WEB-INF/actions/main.bsh order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r509955 - in /ofbiz/trunk/applications: ecommerce/webapp/ecommerce/WEB-INF/actions/main.bsh order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh

jonesde
Author: jonesde
Date: Wed Feb 21 02:00:24 2007
New Revision: 509955

URL: http://svn.apache.org/viewvc?view=rev&rev=509955
Log:
Commented out code that attempts to go back to the same category on language change, but really doesn't go back to the same page AND it messes of the main page which IMO is not acceptable; if this is important it should be done that SAME way we go back to the same page on an add-to-cart

Modified:
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/main.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/main.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/main.bsh?view=diff&rev=509955&r1=509954&r2=509955
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/main.bsh (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/main.bsh Wed Feb 21 02:00:24 2007
@@ -21,11 +21,19 @@
 
 catalogId = CatalogWorker.getCurrentCatalogId(request);
 promoCat = CatalogWorker.getCatalogPromotionsCategoryId(request, catalogId);
+request.setAttribute("productCategoryId", promoCat);    
 
+/* NOTE DEJ20070220 woah, this is doing weird stuff like always showing the last viewed category when going to the main page;
+ * It appears this was done for to make it go back to the desired category after logging in, but this is NOT the place to do that,
+ * and IMO this is an unacceptable side-effect.
+ *
+ * The whole thing should be re-thought, and should preferably NOT use a custom session variable or try to go through the main page.
+ *
+ * NOTE: see section commented out in category.bsh for the other part of this.
 productCategoryId = session.getAttribute("productCategoryId");
 if (productCategoryId == null) {
     request.setAttribute("productCategoryId", promoCat);    
-}
-else {
+} else {
     request.setAttribute("productCategoryId", productCategoryId);    
 }
+*/

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh?view=diff&rev=509955&r1=509954&r2=509955
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh Wed Feb 21 02:00:24 2007
@@ -29,13 +29,16 @@
 
 detailScreen = "categorydetail";
 catalogName = CatalogWorker.getCatalogName(request);
-delegator = request.getAttribute("delegator");
+
 productCategoryId = request.getAttribute("productCategoryId");
 if (productCategoryId == null) {
     productCategoryId = parameters.get("category_id");
 }
 context.put("productCategoryId", productCategoryId);
 
+/* NOTE DEJ20070220: this is a weird way to do this and caused unacceptable side effects as described in the related
+ * comment in the main.bsh file
+ *
 if (productCategoryId != null) {
     session.setAttribute("productCategoryId",productCategoryId);// for language change
     previousParams = session.getAttribute("_PREVIOUS_PARAMS_");
@@ -47,7 +50,8 @@
     }
     session.setAttribute("_PREVIOUS_PARAMS_", previousParams);    // for login
     context.put("previousParams", previousParams);
-}    
+}
+ */    
 
 category = delegator.findByPrimaryKeyCache("ProductCategory", UtilMisc.toMap("productCategoryId", productCategoryId));
 if (category != null) {