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

ProductStoreData.xml contains UPS NEXT_DAY not present in ShippingData.xml

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 14.12.01, 16.11.01
    • Component/s: product
    • Labels:
      None

      Description

      A foreign key error is thrown when shipping data is manually entered by copying the xml from ProductStoreData.xml into the text field at https://localhost:8443/webtools/control/entityImport after doing the same for ShippingData.xml. I don't think the error is seen when the data is imported by running load-seed because it creates dummy foreign keys.

        Activity

        Hide
        deepak.dixit Deepak Dixit added a comment -

        Thanks Christian Carlo, Rishi Solanki and Divesh Dutta for your valuable thoughts.

        Thanks Divesh, your patch has been committed at
        Trunk at r#1679732
        14.12 at r#1679733

        Show
        deepak.dixit Deepak Dixit added a comment - Thanks Christian Carlo, Rishi Solanki and Divesh Dutta for your valuable thoughts. Thanks Divesh, your patch has been committed at Trunk at r#1679732 14.12 at r#1679733
        Hide
        diveshdut Divesh Dutta added a comment -

        Here is the patch to fix the issue.

        Show
        diveshdut Divesh Dutta added a comment - Here is the patch to fix the issue.
        Hide
        diveshdut Divesh Dutta added a comment -

        As Rishi mentioned, these error will never come while loading data from ant commands because these files do not have entry in ofbiz-component.xml . Also these files are only used in method createProductStoreWithDefaultSetting in SetupEvents.xml . These files are not made to imported directly from https://localhost:8443/webtools/control/entityImport .

        Actually in createProductStoreWithDefaultSetting method, productStoreId will be generated dynamically and stored in variable PRODUCTSTOREID. And in code

        <ProductStorePaymentSetting productStoreId="PRODUCTSTOREID" paymentMethodTypeId="CREDIT_CARD" paymentServiceTypeEnumId="PRDS_PAY_AUTH" paymentService="alwaysApproveCCProcessor" paymentCustomMethodId="CC_AUTH_ALWAYSAPPROV"/>
        

        productStoreId="PRODUCTSTOREID is not a value itself but its expected to take value from variable PRODUCTSTOREID and assign it to a field productStoreId of ProductStorePaymentSetting table.

        When you go to https://localhost:8443/ofbizsetup/control/main , you can set up store with all the default settings. For this purpose, ProductStoreData.xml file have the template for creating the store.

        Now to address the original issue, we can use NEXT_DAY_AIR instead of NEXT_DAY in ProductStoreData.xml. NEXT_DAY_AIR have entry in ShippingData.xml

        Show
        diveshdut Divesh Dutta added a comment - As Rishi mentioned, these error will never come while loading data from ant commands because these files do not have entry in ofbiz-component.xml . Also these files are only used in method createProductStoreWithDefaultSetting in SetupEvents.xml . These files are not made to imported directly from https://localhost:8443/webtools/control/entityImport . Actually in createProductStoreWithDefaultSetting method, productStoreId will be generated dynamically and stored in variable PRODUCTSTOREID. And in code <ProductStorePaymentSetting productStoreId= "PRODUCTSTOREID" paymentMethodTypeId= "CREDIT_CARD" paymentServiceTypeEnumId= "PRDS_PAY_AUTH" paymentService= "alwaysApproveCCProcessor" paymentCustomMethodId= "CC_AUTH_ALWAYSAPPROV" /> productStoreId="PRODUCTSTOREID is not a value itself but its expected to take value from variable PRODUCTSTOREID and assign it to a field productStoreId of ProductStorePaymentSetting table. When you go to https://localhost:8443/ofbizsetup/control/main , you can set up store with all the default settings. For this purpose, ProductStoreData.xml file have the template for creating the store. Now to address the original issue, we can use NEXT_DAY_AIR instead of NEXT_DAY in ProductStoreData.xml. NEXT_DAY_AIR have entry in ShippingData.xml
        Hide
        rishisolankii Rishi Solanki added a comment -

        Christian Carlow: I see there is no entry in any ofbiz-component.xml (trunk) so these data won't be loaded on running load-seed or on running any data command. Also it is loaded on running the SetupEvents.xml method createProductStoreWithDefaultSetting. Last point to notice is the ProductStore entity not available in the system with productStoreId as 'PRODUCTSTOREID'. So I think the data referred in the ticket should have some precondition or can be loaded via some flow which needs to be follow. Quick reference of data with productStoreId not available which is causing the current problem you are facing;

         
        <ProductStorePaymentSetting productStoreId="PRODUCTSTOREID" paymentMethodTypeId="CREDIT_CARD" paymentServiceTypeEnumId="PRDS_PAY_AUTH" paymentService="alwaysApproveCCProcessor" paymentCustomMethodId="CC_AUTH_ALWAYSAPPROV"/>
        

        I would say the files mentioned in the ticket should have comment on how to use them and in which case. I'll try to dig further and share more details. Any community member know the reason then please share. Thanks!

        Show
        rishisolankii Rishi Solanki added a comment - Christian Carlow : I see there is no entry in any ofbiz-component.xml (trunk) so these data won't be loaded on running load-seed or on running any data command. Also it is loaded on running the SetupEvents.xml method createProductStoreWithDefaultSetting. Last point to notice is the ProductStore entity not available in the system with productStoreId as 'PRODUCTSTOREID'. So I think the data referred in the ticket should have some precondition or can be loaded via some flow which needs to be follow. Quick reference of data with productStoreId not available which is causing the current problem you are facing; <ProductStorePaymentSetting productStoreId= "PRODUCTSTOREID" paymentMethodTypeId= "CREDIT_CARD" paymentServiceTypeEnumId= "PRDS_PAY_AUTH" paymentService= "alwaysApproveCCProcessor" paymentCustomMethodId= "CC_AUTH_ALWAYSAPPROV" /> I would say the files mentioned in the ticket should have comment on how to use them and in which case. I'll try to dig further and share more details. Any community member know the reason then please share. Thanks!

          People

          • Assignee:
            deepak.dixit Deepak Dixit
            Reporter:
            ofbizzer Christian Carlow
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development