ONLYOFFICE / DocumentServer

ONLYOFFICE Docs is a free collaborative online office suite comprising viewers and editors for texts, spreadsheets and presentations, forms and PDF, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
https://www.onlyoffice.com
GNU Affero General Public License v3.0
4.88k stars 1.09k forks source link

DocumentBuilder: GetNumbering is not working #499

Closed aleksinpavel closed 5 years ago

aleksinpavel commented 5 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? Right now it's not possible to get information about numbering using DocumentBuilder's function GetNumbering for paragraph. It's throwing error on calling it.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Open Document editor.
  2. Set numbered list for first paragraph using OnlyOffice interface image
  3. Open Plugins section and create new Macros with this code:
    var oDocument = Api.GetDocument();
    var oParagraph, oRun, oNum;
    oParagraph = oDocument.GetElement(0);
    try {
    oNum = oParagraph.GetNumbering();
    } catch (err) {
    console.log(err);
    }
  4. Open DevTools in browser with console
  5. See the error image

What is the expected behavior? GetNumbering() must return info about numbering according to DocumentBuilder documentation. Did this work in previous versions of DocumentServer? not checked DocumentServer version: 5.2.8 Operating System: macOS 10.14.2 Browser version: Google Chrome 71.0.3578.98 (64 bit)

flaminestone commented 5 years ago

Hello @aleksinpavel. Yes, it is bug, thank you. It will fixed in future release

flaminestone commented 5 years ago

Fix https://github.com/ONLYOFFICE/sdkjs/commit/017a33cd1d1f8e18df6c9d7c1657fb0be77ca410

ShockwaveNN commented 5 years ago

DocumentServer 5.3.0 is released. This issue has been fixed.