Free Support Forum - aspose.cloud

Bug introduced in version 20.7 of aspose-words-cloud-node - getDocumentDrawingObjects

Hello,

In version 20.7 of aspose-words-cloud-node a bug has been introduced affecting the getDocumentDrawingObjects method. It may also affect other methods, I have not tested this. This bug still exists in the latest (20.9.0) version as well, please fix it urgently.

See https://github.com/aspose-words-cloud/aspose-words-cloud-node/blame/master/src/model/linkElement.ts, the change made on 2nd June included changing baseName from ‘link’ to ‘Link’. This is incorrect, as in the API response for this request the property is ‘link’ and not ‘Link’.

Example API response (GET request made to https://api.aspose.cloud/v4.0/words/0a23209e-0e19-48b7-a544-f5391e159f7d.docx/drawingObjects?folder=WordDocuments%2FLogoDocuments):

{
    "DrawingObjects": {
        "List": [
            {
                "link": {
                    "Href": "https://api.aspose.cloud/v4.0/words/0a23209e-0e19-48b7-a544-f5391e159f7d.docx/sections/0/headersfooters/0/paragraphs/0/drawingObjects/0?folder=WordDocuments%5cLogoDocuments",
                    "Rel": "self"
                }
            },
            {
                "link": {
                    "Href": "https://api.aspose.cloud/v4.0/words/0a23209e-0e19-48b7-a544-f5391e159f7d.docx/sections/0/headersfooters/0/paragraphs/0/drawingObjects/1?folder=WordDocuments%5cLogoDocuments",
                    "Rel": "self"
                }
            },
            {
                "link": {
                    "Href": "https://api.aspose.cloud/v4.0/words/0a23209e-0e19-48b7-a544-f5391e159f7d.docx/sections/0/headersfooters/1/paragraphs/0/drawingObjects/0?folder=WordDocuments%5cLogoDocuments",
                    "Rel": "self"
                }
            },
            {
                "link": {
                    "Href": "https://api.aspose.cloud/v4.0/words/0a23209e-0e19-48b7-a544-f5391e159f7d.docx/sections/0/headersfooters/1/paragraphs/0/drawingObjects/1?folder=WordDocuments%5cLogoDocuments",
                    "Rel": "self"
                }
            }
        ],
        "link": {
            "Href": "https://api.aspose.cloud/v4.0/words/0a23209e-0e19-48b7-a544-f5391e159f7d.docx/drawingObjects?folder=WordDocuments%5cLogoDocuments",
            "Rel": "self"
        }
    },
    "RequestId": "Root=1-5f7da94a-5f152c1d222b06833efbac5a"
}

Now please see what the nodejs sdk is doing below. First I have included our test-bed code, secondly the response from version 20.6.0 and thirdly the response from version 20.7.0

const sid = "**private**";
const key = "**private**";
const Aspose6 = require("aspose6"); // "aspose6": "npm:asposewordscloud@20.6.0"
const aspose6 = new Aspose6.WordsApi(sid, key);
const Aspose7 = require("aspose7"); // "aspose7": "npm:asposewordscloud@20.7.0"
const aspose7 = new Aspose7.WordsApi(sid, key);

const wordDocument = "0a23209e-0e19-48b7-a544-f5391e159f7d.docx";

async function getDrawingObjects6() {
  const getDrawingObjectsRequest = new Aspose6.GetDocumentDrawingObjectsRequest({
    "name": wordDocument,
    "folder": "WordDocuments/LogoDocuments",
    "nodePath": ""
  });

  const drawingObjectsResponse = await aspose6.getDocumentDrawingObjects(getDrawingObjectsRequest);
  
  console.log('VERSION 6');
  console.log(JSON.stringify(drawingObjectsResponse.body, null, 2));
}

async function getDrawingObjects7() {
  const getDrawingObjectsRequest = new Aspose7.GetDocumentDrawingObjectsRequest({
    "name": wordDocument,
    "folder": "WordDocuments/LogoDocuments",
    "nodePath": ""
  });

  const drawingObjectsResponse = await aspose7.getDocumentDrawingObjects(getDrawingObjectsRequest);
  
  console.log('VERSION 7');
  console.log(JSON.stringify(drawingObjectsResponse.body, null, 2));
}

getDrawingObjects6()
  .then(() => getDrawingObjects7());

Version 20.6.0:

{
  "requestId": "Root=1-5f7db18b-01b270793bcb9d391651b53d",
  "drawingObjects": {
    "link": {
      "href": "https://api.aspose.cloud/v4.0/words/0a23209e-0e19-48b7-a544-f5391e159f7d.docx/drawingObjects?folder=WordDocuments%5cLogoDocuments",
      "rel": "self"
    },
    "list": [
      {
        "link": {
          "href": "https://api.aspose.cloud/v4.0/words/0a23209e-0e19-48b7-a544-f5391e159f7d.docx/sections/0/headersfooters/0/paragraphs/0/drawingObjects/0?folder=WordDocuments%5cLogoDocuments",
          "rel": "self"
        }
      },
      {
        "link": {
          "href": "https://api.aspose.cloud/v4.0/words/0a23209e-0e19-48b7-a544-f5391e159f7d.docx/sections/0/headersfooters/0/paragraphs/0/drawingObjects/1?folder=WordDocuments%5cLogoDocuments",
          "rel": "self"
        }
      },
      {
        "link": {
          "href": "https://api.aspose.cloud/v4.0/words/0a23209e-0e19-48b7-a544-f5391e159f7d.docx/sections/0/headersfooters/1/paragraphs/0/drawingObjects/0?folder=WordDocuments%5cLogoDocuments",
          "rel": "self"
        }
      },
      {
        "link": {
          "href": "https://api.aspose.cloud/v4.0/words/0a23209e-0e19-48b7-a544-f5391e159f7d.docx/sections/0/headersfooters/1/paragraphs/0/drawingObjects/1?folder=WordDocuments%5cLogoDocuments",
          "rel": "self"
        }
      }
    ]
  }
}

Version 20.7.0:

{
  "requestId": "Root=1-5f7db18d-27e80fd54743db7e6c1024e8",
  "drawingObjects": {
    "list": [
      {},
      {},
      {},
      {}
    ]
  }
}

As you can see this is clearly wrong, the drawingObjects.list array elements are not being populated correctly.

This bug is preventing us from upgrading from version 20.6.0 of the asposewordscloud package

@RBIEGTechTeam

We are sorry for the inconvenience. We have noticed the regression issue and logged a ticket WORDSCLOUD-1380 for further investigation and rectification.

@RBIEGTechTeam

Thanks for your patience. We have fixed your above reported issue in the latest release. Please use Aspose.Words Cloud SDK for Node.js 20.10 for the fix.

Thank you, we have tested with version 20.10 and we are no longer seeing the issue.

1 Like

The issues you have found earlier (filed as WORDSCLOUD-1380) have been fixed in this update. This message was posted using Bugs notification tool by tilal.ahmad