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

Create content for product causes exception

    Details

      Description

      Using demo data.
      https://localhost:8443/catalog/control/EditProductContent?productId=CPU-586
      Console output...

      2015-02-11 11:08:44,547 |http-bio-8443-exec-3 |ServiceEcaCondition |I| From Field (contentAssocTypeId) is not found in context for createContent, defaulting to null.
      2015-02-11 11:08:44,557 |http-bio-8443-exec-3 |ServiceEcaRule |I| For Service ECA [createContent] on [commit] got false for condition: [contentAssocTypeId][is-not-empty][true][String]
      2015-02-11 11:08:44,564 |http-bio-8443-exec-3 |ServiceEcaCondition |I| From Field (contentAssocTypeId) is not found in context for createContent, defaulting to null.
      2015-02-11 11:08:44,565 |http-bio-8443-exec-3 |ServiceEcaRule |I| For Service ECA [createContent] on [commit] got false for condition: [contentAssocTypeId][is-not-empty][true][String]
      2015-02-11 11:08:44,566 |http-bio-8443-exec-3 |ServiceEcaCondition |I| From Field (contentPurposeTypeId) is not found in context for createContent, defaulting to null.
      2015-02-11 11:08:44,567 |http-bio-8443-exec-3 |ServiceEcaRule |I| For Service ECA [createContent] on [commit] got false for condition: [contentPurposeTypeId][is-not-empty][true][String]
      2015-02-11 11:08:44,568 |http-bio-8443-exec-3 |ServiceEcaRule |I| Running Service ECA Service: createContentAlternativeUrl, triggered by rule on Service: createContent
      2015-02-11 11:08:44,581 |http-bio-8443-exec-3 |ServiceEcaRule |I| For Service ECA [createProductContent] on [in-validate] got false for condition: [contentId][is-empty][true][String]
      2015-02-11 11:08:44,635 |http-bio-8443-exec-3 |GenericDelegator |E| Failure in create operation for entity [ProductContent]: org.ofbiz.entity.GenericEntityException: Error while inserting: [GenericEntity:ProductContent][contentId,10001(java.lang.String)][createdStamp,2015-02-11 11:08:44.587(java.sql.Timestamp)][createdTxStamp,2015-02-11 11:08:32.59(java.sql.Timestamp)][fromDate,2015-02-11 11:08:23.0(java.sql.Timestamp)][lastUpdatedStamp,2015-02-11 11:08:44.587(java.sql.Timestamp)][lastUpdatedTxStamp,2015-02-11 11:08:32.59(java.sql.Timestamp)][productContentTypeId,XTRA_IMG_E_SMALL(java.lang.String)][productId,CPU-586(java.lang.String)][thruDate,null()] (SQL Exception while executing the following:INSERT INTO PRODUCT_CONTENT (PRODUCT_ID, CONTENT_ID, PRODUCT_CONTENT_TYPE_ID, FROM_DATE, THRU_DATE, PURCHASE_FROM_DATE, PURCHASE_THRU_DATE, USE_COUNT_LIMIT, USE_TIME, USE_TIME_UOM_ID, USE_ROLE_TYPE_ID, SEQUENCE_NUM, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Cannot add or update a child row: a foreign key constraint fails (`ofbiz`.`PRODUCT_CONTENT`, CONSTRAINT `PROD_CNT_TYPE` FOREIGN KEY (`PRODUCT_CONTENT_TYPE_ID`) REFERENCES `PRODUCT_CONTENT_TYPE` (`PRODUCT_CONTENT_TYPE_ID`)))). Rolling back transaction.

        Activity

        Hide
        deepak.dixit Deepak Dixit added a comment - - edited

        Added check to avoid error,
        Committed in
        Trunk at r#1668277
        R14.12 at r#1668278
        R13.07 at r#1668283
        R12.04 at r#1668294

        ProductContent creation need more refinement, as its try to scale image for each type of image content. And if we select product content type Image then it create plain text content for this. Will create new ticket for this issue.

        Show
        deepak.dixit Deepak Dixit added a comment - - edited Added check to avoid error, Committed in Trunk at r#1668277 R14.12 at r#1668278 R13.07 at r#1668283 R12.04 at r#1668294 ProductContent creation need more refinement, as its try to scale image for each type of image content. And if we select product content type Image then it create plain text content for this. Will create new ticket for this issue.
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Forgot to close issue.

        Show
        deepak.dixit Deepak Dixit added a comment - Forgot to close issue.

          People

          • Assignee:
            deepak.dixit Deepak Dixit
            Reporter:
            wt Wai
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development