svn commit: r1786525 - /ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/ReviewForms.xml

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

svn commit: r1786525 - /ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/ReviewForms.xml

jleroux@apache.org
Author: jleroux
Date: Sat Mar 11 19:25:31 2017
New Revision: 1786525

URL: http://svn.apache.org/viewvc?rev=1786525&view=rev
Log:
Fixed: catalog/control/FindReviews does not render proper column data
(OFBIZ-)

go to https://localhost:8443/catalog/control/FindReviews
find productId=GZ-2644
notice the table columns do not match the data

Here the problem is :
1. FindReviews page includes "ListReviews" form to render this content.
2. Here "use-when" attribute is used with "field" element on "productRating"
  and "productReview" for conditions "statusId != 'PRR_DELETED'" and
  "statusId == 'PRR_DELETED'"
3. Citing documentation of "ignore-when": "This attribute is defined to enable
  ignoring a field on a form of type list or multi, which is not possible using
  use-when attribute".
4. So when condition is not true it renders a empty <td></td> causing data to
  be placed inappropriately
5. Here if the "use-when" attribute is replaced with "ignore-when" attribute
  it will make the columns to match with apt data.

Solution:
Replace "use-when" attribute with "ignore-when" attribute amending conditions
used accordingly.

Thanks: Wai Tam for the report, Aditya Sharma for the patch

Modified:
    ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/ReviewForms.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/ReviewForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/ReviewForms.xml?rev=1786525&r1=1786524&r2=1786525&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/ReviewForms.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/ReviewForms.xml Sat Mar 11 19:25:31 2017
@@ -63,10 +63,10 @@ under the License.
         </field>
         <field name="statusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem"/></field>
         <field name="userLoginId" title="${uiLabelMap.ProductReviewBy}" ><display/></field>
-        <field name="productRating" use-when="${statusId != 'PRR_DELETED'}"><text/></field>
-        <field name="productRating" use-when="${statusId == 'PRR_DELETED'}"><text disabled="true"/></field>
-        <field name="productReview" use-when="${statusId != 'PRR_DELETED'}"><textarea/></field>
-        <field name="productReview" use-when="${statusId == 'PRR_DELETED'}"><textarea read-only="true"/></field>
+        <field name="productRating" ignore-when="${statusId == 'PRR_DELETED'}"><text/></field>
+        <field name="productRating" ignore-when="${statusId != 'PRR_DELETED'}"><text disabled="true"/></field>
+        <field name="productReview" ignore-when="${statusId == 'PRR_DELETED'}"><textarea/></field>
+        <field name="productReview" ignore-when="${statusId != 'PRR_DELETED'}"><textarea read-only="true"/></field>
         <field name="submitButton" title="${uiLabelMap.CommonUpdate}" use-when="${statusId != 'PRR_DELETED'}"><submit button-type="button"/></field>
         <field name="approve" widget-style="buttontext" use-when="${statusId == 'PRR_PENDING'}">
             <hyperlink description="${uiLabelMap.FormFieldTitle_approve}" target="updateProductReviewStatus" also-hidden="false">