Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-9133

catalog/control/FindReviews does not render proper column data

    Details

      Description

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

      1. ofbiz-9133-Solution.png
        131 kB
        Aditya Sharma
      2. ofbiz-9133-Problem2.png
        121 kB
        Aditya Sharma
      3. ofbiz-9133-Problem1.png
        128 kB
        Aditya Sharma
      4. ofbiz-9133.patch
        2 kB
        Aditya Sharma

        Activity

        Hide
        pfm.smits Pierre Smits added a comment -

        This doesn't seem to be a bug, but rather an improvement, as it appears that the original contributor intended to not show all the fields of the entity in the form.

        Show
        pfm.smits Pierre Smits added a comment - This doesn't seem to be a bug, but rather an improvement, as it appears that the original contributor intended to not show all the fields of the entity in the form.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Does this happen when using a simple form?

        Show
        jacques.le.roux Jacques Le Roux added a comment - Does this happen when using a simple form?
        Hide
        aditya.sharma Aditya Sharma added a comment -

        ofbiz-9133-Problem1.png ofbiz-9133-Problem1.png : Problem Reproduced.
        ofbiz-9133-Solution.png :Solution applied

        Show
        aditya.sharma Aditya Sharma added a comment - ofbiz-9133-Problem1.png ofbiz-9133-Problem1.png : Problem Reproduced. ofbiz-9133-Solution.png :Solution applied
        Hide
        aditya.sharma Aditya Sharma added a comment -

        Problem may exist for list form only.
        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.

        Show
        aditya.sharma Aditya Sharma added a comment - Problem may exist for list form only. 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.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Actually I was confusing when I wrote

        Does this happen when using a simple form?

        I meant: does this happen when using a form of type list. Anyway, I confirm your patch work Aditya, I'll commit soon.

        Show
        jacques.le.roux Jacques Le Roux added a comment - Actually I was confusing when I wrote Does this happen when using a simple form? I meant: does this happen when using a form of type list. Anyway, I confirm your patch work Aditya, I'll commit soon.
        Hide
        jacques.le.roux Jacques Le Roux added a comment - - edited

        Thanks Wai for the report.

        Thanks Aditya,
        Your patch is in
        trunk r1786525
        R16.11 r1786526
        R15.12 r1786527
        R14.12 r1786528
        R13.07 r1786529

        Show
        jacques.le.roux Jacques Le Roux added a comment - - edited Thanks Wai for the report. Thanks Aditya, Your patch is in trunk r1786525 R16.11 r1786526 R15.12 r1786527 R14.12 r1786528 R13.07 r1786529
        Hide
        wt Wai added a comment -

        Is this just a fix for one file or should there be a source wide review to see if the same problem exists in all forms as well.

        Show
        wt Wai added a comment - Is this just a fix for one file or should there be a source wide review to see if the same problem exists in all forms as well.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Hi Wai,

        It seems to me that this issue was specific to this form. Feel free to open new issues if you want to review or know other related cases. I guess if after reviewing few forms using ignore-when and you don't find any issues it not worth reviewning all forms

        Thanks to care!

        Show
        jacques.le.roux Jacques Le Roux added a comment - Hi Wai, It seems to me that this issue was specific to this form. Feel free to open new issues if you want to review or know other related cases. I guess if after reviewing few forms using ignore-when and you don't find any issues it not worth reviewning all forms Thanks to care!
        Hide
        aditya.sharma Aditya Sharma added a comment - - edited

        Thanks Jacques Le Roux
        Thanks Wai for reporting the bug.
        Agreed to Jacques Le Roux that this issue may be specific to this form. The issue occurs only when same "field" has multiple conditions applied that too in "List" type form.

        Show
        aditya.sharma Aditya Sharma added a comment - - edited Thanks Jacques Le Roux Thanks Wai for reporting the bug. Agreed to Jacques Le Roux that this issue may be specific to this form. The issue occurs only when same "field" has multiple conditions applied that too in "List" type form.

          People

          • Assignee:
            jacques.le.roux Jacques Le Roux
            Reporter:
            wt Wai
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development