Permalink
Browse files

Fix an issue reported by Duc Trung NGUYEN on user ML:

>  I tried to test the theme multiflex (for ecommerce) and detect a small
> problem as the following: (USING http://demo-trunk.ofbiz.apache.org)
> 
> 1.connect to catalog manager
> 2.go to "store" tab and select the store with id 9000
> 3.change its viual theme to MULTIFLEX
> 
> 4.open the ecommerce site (it's ok with new theme)
> 5.select a catagory from the categories menu on the left side.
> 6.select another language
> 
> And the problem come up:
> The theme now is EC_DEFAULT instead of MULTIFLEX

It was related to a not finished change introduced with  http://svn.apache.org/viewvc?view=revision&revision=1128983
I mean the addCheckValue request and sequel... 

I briefly tried to do it in a simpler way using a redirected parameter on setSessionLocale request, but got issue, gave up and simply reused the same way but moved the simple method from AffiliateSimpleEvents.xml to CustomerEvents.xml


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1426787 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 8321c63 commit ad0dcadf50070d1d7d5fd01fff0e97e47520a43e @JacquesLeRoux JacquesLeRoux committed Dec 29, 2012
@@ -27,13 +27,16 @@ import org.ofbiz.entity.*;
import org.ofbiz.product.catalog.*;
import org.ofbiz.product.category.CategoryWorker;
import org.ofbiz.product.category.CategoryContentWrapper;
+import org.ofbiz.product.store.ProductStoreWorker;
detailScreen = "categorydetail";
catalogName = CatalogWorker.getCatalogName(request);
productCategoryId = request.getAttribute("productCategoryId") ?: parameters.category_id;
context.productCategoryId = productCategoryId;
+context.productStore = ProductStoreWorker.getProductStore(request);
+
pageTitle = null;
metaDescription = null;
metaKeywords = null;
@@ -1314,4 +1314,9 @@ under the License.
<default-message property="CommonGenericServiceSuccessMessage" resource="CommonUiLabels"></default-message>
</call-service>
</simple-method>
+ <simple-method method-name="fromSetSessionLocale"
+ short-description="Add field to request for redirection after SetSessionLocale" login-required="false">
+ <set field="fromSetSessionLocale" value="true"/>
+ <field-to-request field="fromSetSessionLocale" request-name="fromSetSessionLocale"/>
+ </simple-method>
</simple-methods>
@@ -126,10 +126,5 @@ under the License.
<call-service service-name="createAffiliate" in-map-name="af_context">
<default-message resource="EcommerceUiLabels" property="EcommerceAffiliateCreatedSuccessfully"/>
</call-service>
-
- </simple-method>
- <simple-method method-name="addCheckValue" short-description="Add field to request for investigation purpose" login-required="false">
- <set field="checkValue" value="check" type="PlainString"/>
- <field-to-request field="checkValue" request-name="checkValue"/>
</simple-method>
</simple-methods>
@@ -132,7 +132,7 @@ under the License.
<request-map uri="setSessionLocale">
<security https="false" auth="false"/>
<event type="java" path="org.ofbiz.common.CommonEvents" invoke="setSessionLocale"/>
- <response name="success" type="request-redirect" value="checkValue"/>
+ <response name="success" type="request-redirect" value="fromSetSessionLocale"/>
<response name="error" type="view" value="main"/>
</request-map>
@@ -1966,8 +1966,8 @@ under the License.
<security https="true" auth="false"/>
<response name="success" type="view" value="productCategoryList" save-current-view="true"/>
</request-map>
- <request-map uri="checkValue">
- <event type="simple" path="component://ecommerce/script/org/ofbiz/ecommerce/misc/AffiliateSimpleEvents.xml" invoke="addCheckValue"/>
+ <request-map uri="fromSetSessionLocale">
+ <event type="simple" path="component://ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml" invoke="fromSetSessionLocale"/>
<response name="success" type="view-last" value="main"/>
<response name="error" type="view" value="main"/>
</request-map>
@@ -534,7 +534,7 @@ under the License.
<property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="OrderUiLabels" map-name="uiLabelMap" global="true"/>
<script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy"/>
- <set field="check" type="PlainString" value="${groovy: return request.getAttribute('checkValue');}"/>
+ <set field="fromSetSessionLocale" value="${groovy: return request.getAttribute('fromSetSessionLocale');}"/>
<set field="visualThemeId" from-field="productStore.visualThemeId" default-value="EC_DEFAULT"/>
<service service-name="getVisualThemeResources">
<field-map field-name="visualThemeId"/>
@@ -545,7 +545,7 @@ under the License.
<widgets>
<section>
<condition>
- <if-compare operator="equals" value="check" field="check" type="PlainString"/>
+ <if-compare operator="equals" value="true" field="fromSetSessionLocale"/>
</condition>
<widgets>
<include-screen name="category"/>

0 comments on commit ad0dcad

Please sign in to comment.