Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetComments failed in some file #825

Closed
raochq opened this issue Apr 25, 2021 · 5 comments
Closed

GetComments failed in some file #825

raochq opened this issue Apr 25, 2021 · 5 comments
Labels
confirmed This issue can be reproduced
Projects

Comments

@raochq
Copy link
Contributor

raochq commented Apr 25, 2021

The function "(f *File) GetComments() "may renturn empty in some file.

I find my excel file (xl\worksheets_rels\sheet1.xml.rels) is like this. The Target of comments is a abslute path, not a relatively path.
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="comments" Target="/xl/comments/comment2.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"/><Relationship Id="anysvml" Target="/xl/drawings/commentsDrawing2.vml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing"/></Relationships>

the implement of GetComments is like this:
f.commentsReader("xl" + strings.TrimPrefix(f.getSheetComments(filepath.Base(path)), ".."))
(see github.com/360EntSecGroup-Skylar/excelize/comment.go:42)

@xuri
Copy link
Member

xuri commented Apr 25, 2021

Thanks for your feedback, could you provide more details or a spreadsheet xlsx attachment without confidential info?

@raochq
Copy link
Contributor Author

raochq commented Apr 25, 2021

comment.zip
this is my excel file

@xuri xuri added the confirmed This issue can be reproduced label Apr 26, 2021
@xuri xuri closed this as completed in e5c5ecc Apr 26, 2021
@xuri
Copy link
Member

xuri commented Apr 26, 2021

I have fixed it, please try to use the master branch code, and this patch will be released in the next version.

raochq added a commit to raochq/excelize that referenced this issue Apr 26, 2021
Fixed qax-os#825, improves compatibility for comments with absolute XML path
@raochq
Copy link
Contributor Author

raochq commented Apr 26, 2021

this problem is not fix in windows.

filepath.IsAbs("/xl/worksheets/sheet1.xml") return false in windows.

@xuri xuri added the in progress Working in progress label Apr 27, 2021
xuri added a commit that referenced this issue Apr 27, 2021
@xuri xuri removed the in progress Working in progress label Apr 27, 2021
@xuri
Copy link
Member

xuri commented Apr 27, 2021

I have fixed it, please try to use the master branch code.

@xuri xuri added this to Closed in v2.4.1 May 7, 2021
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
…ue when get and add comments on multi authors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed This issue can be reproduced
Projects
No open projects
v2.4.1
Bugfix
Development

No branches or pull requests

2 participants