ONLYOFFICE / DocumentBuilder

ONLYOFFICE Document Builder is powerful text, spreadsheet, presentation and PDF generating tool
https://www.onlyoffice.com/document-builder.aspx
GNU Affero General Public License v3.0
112 stars 56 forks source link

`Range#select()` cause JS error `Uncaught TypeError: this.Uy.zta is not a function` #65

Closed niushuai1991 closed 3 years ago

niushuai1991 commented 3 years ago

Describe your problem:

I need to replace some text in the spreadsheet, but replacetextsmart () doesn't work properly.

Be clear in your description of the problem. Open an issue with a descriptive title and a summary in complete sentences.

I used the sample code in the API documentation https://api.onlyoffice.com/docbuilder/spreadsheetapi/api/replacetextsmart

Operation results:

execute_run_code: oRange.Select();
execute_run: Uncaught TypeError: oRange.Select is not a function

If I delete the code that contains the “oRange”,Operation results:

execute_run_code: Api.ReplaceTextSmart(["Cell 1", "Cell 2"]);
execute_run: Uncaught TypeError: Api.ReplaceTextSmart is not a function

Steps to reproduce the problem:

  1. copy code from https://api.onlyoffice.com/docbuilder/spreadsheetapi/api/replacetextsmart
  2. save the code to the file demo.docbuilder
  3. excute command "docbuilder.exe demo.docbuilder"

DocumentBuilder version: documentbuilder-4.4.1

Installation method: Extract and use

Operating system: Windows 10 20H2

ShockwaveNN commented 3 years ago

Hi

documentbuilder-4.4.1

This version is very old, could you update it to the latest stable version?

niushuai1991 commented 3 years ago

Yes,I need an updated version,I downloaded the latest stable version from here https://www.onlyoffice.com/zh/download.aspx#builder But it still doesn't work, “docbuilder.exe demo.docbuilder” the result of the command is: Uncaught TypeError: this.Uy.zta is not a function

I think the links in this document need to be updated. https://api.onlyoffice.com/docbuilder/gettingstarted

ShockwaveNN commented 3 years ago

Uncaught TypeError: this.Uy.zta is not a function

Yeah, thanks, I think you're right, I've got the same error on v6.4.0, I'll research this right now

ShockwaveNN commented 3 years ago

I've localized the problem - problem not in ReplaceTextSmart method, but in Range#select()

This example also failing: https://api.onlyoffice.com/docbuilder/spreadsheetapi/apirange/select

I've created bug 52684 in our private issue tracker

niushuai1991 commented 3 years ago

Thanks for your answer. The task I am doing is to find the entire spreadsheet and replace specific text with what I want, like "replace all". I want to know if I can finish my work before this bug is fixed?

ShockwaveNN commented 3 years ago

Sorry, I'm not sure that there is a workaround but we hope to include a fix of your problem in the next release v6.4.1 which we hope will be available next week if we do not find any other major problems

niushuai1991 commented 3 years ago

Thank you. It's a great job. I'm waiting for your good news.

ShockwaveNN commented 3 years ago

Our dev team fixed it in https://github.com/ONLYOFFICE/sdkjs/commit/70ed6453bc392d0ed014d47d3e6d210a24dded8a

And we really hope that we can release this version next week (but no promises)

ShockwaveNN commented 3 years ago

DocumentBuilder v6.4.1 is released and this issue is fixed