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

ListItem object doesn't get added to ODText document #2159

Closed
puiuallex opened this issue Oct 28, 2021 · 3 comments · Fixed by #2669
Closed

ListItem object doesn't get added to ODText document #2159

puiuallex opened this issue Oct 28, 2021 · 3 comments · Fixed by #2669
Assignees
Labels
Bug Report Open Document (ODT) Status: Waiting for feedback Question has been asked, waiting for response from PR author
Milestone

Comments

@puiuallex
Copy link

puiuallex commented Oct 28, 2021

Describe the Bug

Hello,

If you load a ODText document and try to create another one with createWriter method but pass the loaded document into it, and if the loaded .odt document contains sections with ListItem/ListItemRun elements those are not getting added to the new created document.

Regards,
Alexe

Steps to Reproduce

  1. Create a document and insert a list into it

  2. Load ODText document.

$document = \PhpOffice\PhpWord\IOFactory::load("document-x", 'ODText');

  1. Create a writer, save it and download it.

$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($document, 'ODText');
$objWriter->save(storage_path('newDocument.odt'));

return response()->download(storage_path("newDocument.odt"));

Expected Behavior

I was expected that the downloaded document was the same as the loaded one.

Current Behavior

The list is missing from the downloaded document.

Context

Please fill in your environment information:

  • PHP Version: 8.0.10
  • PHPWord Version: ^0.18.2
@puiuallex
Copy link
Author

puiuallex commented Oct 28, 2021

It seems like the ListItem/ListItemRun is not recognised when you save the document as ODText.

Even if i create a new PhpWord document, add a new section to it and then add a list item to that section, if you save the file as ODText it doens't show anything. But if you save it as Word2007 (.docx) it works fine.

@Progi1984
Copy link
Member

@puiuallex Hi, Could you send me a file with error, for analyzing it, please ?

@Progi1984 Progi1984 added Open Document (ODT) Status: Waiting for feedback Question has been asked, waiting for response from PR author labels Aug 22, 2024
@Progi1984 Progi1984 self-assigned this Sep 5, 2024
@Progi1984 Progi1984 added this to the 1.4.0 milestone Sep 5, 2024
@Progi1984
Copy link
Member

@puiuallex This issue has been fixed by a maintainer. You can help him by sponsoring him through Github sponsors.

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

Successfully merging a pull request may close this issue.

2 participants