OFBiz
  1. OFBiz
  2. OFBIZ-4838

Party Manager Party StatusId Update Fails

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Release 10.04, Release Branch 11.04, Trunk
    • Fix Version/s: 14.12.01
    • Component/s: party
    • Labels:
      None
    • Environment:

      demo-trunk

      Description

      Party Manager does not update the party status id correctly.
      To reproduce:
      First:
      In Party Manager lookup party id "Company"
      Click "Update" In Profile > Party Group Information
      Note: Status Id drop-down field displays Enabled
      Click "Save"
      Then:
      In Web Tools Interactive version lookup Party party_id = "Company"
      Expect: StatusId = "Enabled"
      Actual: StatusId = NULL

      PartyServices setPartyStatus is not updating the party status.
      The question before fixing, is there any reason to allow null status id's on a party?
      Shouldn't every party either be Enabled or Disabled?

      1. OFBIZ-4838 Party Group Status Change.patch
        1 kB
        Tom Burns
      2. OFBIZ-4838 Party Group Status Change Test.patch
        9 kB
        Tom Burns
      3. OFBIZ-4838 Party Entity Set Status Enabled.patch
        72 kB
        Tom Burns
      4. Analysis Notes from OFBIZ-4838.txt
        2 kB
        Tom Burns
      5. OFBIZ-4838.patch
        9 kB
        Deepak Dixit

        Activity

        Hide
        Anil K Patel added a comment -

        Applied more recent patch r 1626421. Thanks Tom Burns for reporting the issue and providing the fix.
        Thanks Deepak Dixit for testing and making adjustments to the patch.

        Show
        Anil K Patel added a comment - Applied more recent patch r 1626421. Thanks Tom Burns for reporting the issue and providing the fix. Thanks Deepak Dixit for testing and making adjustments to the patch.
        Hide
        Deepak Dixit added a comment -

        Applied the patch and tested it on ofbiz trunk, it is working fine but made some following changes

        1) Done some improvement in code to set status for party with statusId = null.

        2) I don't think that there is any need to update demo data to set party statusId as this case is handled in setPartyStatus service (i.e if statusId is empty then it is considered as "PARTY_ENABLED")

        3) Removed out-parameter newStatusId from service definition as it is not required anywhere other than test-suite created to test "update party status" functionality, so done modifications in test-case itself to fetch party and check its status. Tested it on trunk and it is working as expected.

        Show
        Deepak Dixit added a comment - Applied the patch and tested it on ofbiz trunk, it is working fine but made some following changes 1) Done some improvement in code to set status for party with statusId = null. 2) I don't think that there is any need to update demo data to set party statusId as this case is handled in setPartyStatus service (i.e if statusId is empty then it is considered as "PARTY_ENABLED") 3) Removed out-parameter newStatusId from service definition as it is not required anywhere other than test-suite created to test "update party status" functionality, so done modifications in test-case itself to fetch party and check its status. Tested it on trunk and it is working as expected.
        Hide
        Jacopo Cappellato added a comment -

        This issue has been originally reported by Tom Burns.

        Show
        Jacopo Cappellato added a comment - This issue has been originally reported by Tom Burns.
        Hide
        Tom Burns added a comment -

        OFBIZ-4838 Party Group Status Change.patch has been tested on both 10.4 and 11.04 branches as well as the trunk.

        OFBIZ-4838 Party Entity Set Status Enabled.patch only applies to the trunk due to the different numbers of party entities in different versions.

        In the trunk after applying Party Group Status Change.patch
        The COUNT from PARTY
        EQUALS
        select COUNT from PARTY WHERE status_id='PARTY_ENABLED';
        EQUALS
        127

        Summary of Party XML Entities
        Version Count XML Count DB
        10.4 140 110
        11.4 144 114
        Trunk 159 127

        Separate versions of Party Entity Set Status Enabled.patch for 10.4 and 1.4 can be provided if needed.

        Show
        Tom Burns added a comment - OFBIZ-4838 Party Group Status Change.patch has been tested on both 10.4 and 11.04 branches as well as the trunk. OFBIZ-4838 Party Entity Set Status Enabled.patch only applies to the trunk due to the different numbers of party entities in different versions. In the trunk after applying Party Group Status Change.patch The COUNT from PARTY EQUALS select COUNT from PARTY WHERE status_id='PARTY_ENABLED'; EQUALS 127 Summary of Party XML Entities Version Count XML Count DB 10.4 140 110 11.4 144 114 Trunk 159 127 Separate versions of Party Entity Set Status Enabled.patch for 10.4 and 1.4 can be provided if needed.
        Hide
        Tom Burns added a comment -

        This file describes some issues arising from analysis of OFBIZ-4838.

        Show
        Tom Burns added a comment - This file describes some issues arising from analysis of OFBIZ-4838 .
        Hide
        Tom Burns added a comment -

        The suggested resolution assumes these requirements:
        1. Party status changed is limited to Enabled and Disabled (see StatusItem statusTypeId value="PARTY_STATUS")
        2. Legacy party data with null status_id's must be supported.

        Three patches follow:

        1. Party Entity Set Status Enabled
        a) Allows the drop down in Edit Group Information to display null values.
        If nulls are not displayed then the application is displaying incorrect data.
        Displaying nulls allows a user to change the status to Enabled.
        b) In PartyServices.java > setPartyStatus nulls are set to Enabled AND STORED.
        Note this will be triggered on any change to the party, not just changes to status.

        2. Party Group Status Change sets all party entries in the demo data to Enabled. This makes the demo data consistent with the StatusItem limitation for party.
        Note in PartyManager "Create Party Group" sets status to Enabled by default.

        Other concerns resulting from the analysis of, but not addressed in, this issue may be bugs or required improvements. Notes to be attached.

        3. A throwaway test for the setPartyStatus service.

        Show
        Tom Burns added a comment - The suggested resolution assumes these requirements: 1. Party status changed is limited to Enabled and Disabled (see StatusItem statusTypeId value="PARTY_STATUS") 2. Legacy party data with null status_id's must be supported. Three patches follow: 1. Party Entity Set Status Enabled a) Allows the drop down in Edit Group Information to display null values. If nulls are not displayed then the application is displaying incorrect data. Displaying nulls allows a user to change the status to Enabled. b) In PartyServices.java > setPartyStatus nulls are set to Enabled AND STORED. Note this will be triggered on any change to the party, not just changes to status. 2. Party Group Status Change sets all party entries in the demo data to Enabled. This makes the demo data consistent with the StatusItem limitation for party. Note in PartyManager "Create Party Group" sets status to Enabled by default. Other concerns resulting from the analysis of, but not addressed in, this issue may be bugs or required improvements. Notes to be attached. 3. A throwaway test for the setPartyStatus service.

          People

          • Assignee:
            Anil K Patel
            Reporter:
            Jacopo Cappellato
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development