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

IOFactory::load failed and the funtion setCommentReference not working #2614

Open
LinsVert opened this issue May 29, 2024 · 3 comments
Open
Labels
Bug Report Status: Waiting for feedback Question has been asked, waiting for response from PR author

Comments

@LinsVert
Copy link

LinsVert commented May 29, 2024

Describe the bug and add attachments

When i used IOFactory::load function to load my docx file,throw by:

Argument 3 passed to PhpOffice\PhpWord\Reader\Word2007\AbstractPart::setCommentReference() must be an instance of PhpOffice\PhpWord\Element\AbstractElement, null given, called in vendor/phpoffice/phpword/src/PhpWord/Reader/Word2007/AbstractPart.php on line 337

It should be that the $element in this setCommentReference uses the type specifier,because it works fine in 1.1.0

PS: my file file command tips : Microsoft Word 2007+

Expected behavior

Load word successed

Steps to reproduce

Code:
$word = IOFactory::load($path, $readName);

PHPWord version(s) where the bug happened

1.2.0

PHP version(s) where the bug happened

7.2

@lfglopes
Copy link

lfglopes commented Jul 19, 2024

I'm facing the same problem. Unfortunately I can't share the document.

lfglopes added a commit to legautech/PHPWord that referenced this issue Jul 19, 2024
@Progi1984
Copy link
Member

@lfglopes @LinsVert Hi, Could you give me a simple file, please ?

@Progi1984 Progi1984 added the Status: Waiting for feedback Question has been asked, waiting for response from PR author label Aug 9, 2024
@michalhlavka
Copy link

Screenshot 2024-10-23 at 13 38 54
Screenshot 2024-10-23 at 13 38 33

I can give you this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Status: Waiting for feedback Question has been asked, waiting for response from PR author
Development

No branches or pull requests

4 participants