You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [X ] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
After addSheet(), which contains printer settings and images at the same time, images are displayed correctly (have correct rId in xl/worksheets/sheet2.xml.rels)
What is the current behavior?
After addSheet(), which contains printer settings and images at the same time, file is opened as corupted and images are discarded - removed from file.
rId in xl/worksheets/sheet2.xml.rels has wrong index, because number one is taken by printerSettings
What are the steps to reproduce?
addSheet(), which contains printer settings and images at the same time - the sheet is created in MS Office
Which versions of PhpSpreadsheet and PHP are affected?
1.9.0 and previous versions
This worked for me
PROPOSED PATCH:
/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Rels.php
line: 200
ADD:
if (isset($unparsedLoadedData['sheets'][$pWorksheet->getCodeName()]['printerSettings'])&&is_array($unparsedLoadedData['sheets'][$pWorksheet->getCodeName()]['printerSettings'])) {
$d += count($unparsedLoadedData['sheets'][$pWorksheet->getCodeName()]['printerSettings']);
}
EXPLANATION:
If unparsed data contatains 'printerSettings' rise referenceID
NOT SURE if printerSettings have always referenceID=1, so the patch might not be universal
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.
This is:
What is the expected behavior?
After addSheet(), which contains printer settings and images at the same time, images are displayed correctly (have correct rId in xl/worksheets/sheet2.xml.rels)
What is the current behavior?
After addSheet(), which contains printer settings and images at the same time, file is opened as corupted and images are discarded - removed from file.
rId in xl/worksheets/sheet2.xml.rels has wrong index, because number one is taken by printerSettings
What are the steps to reproduce?
addSheet(), which contains printer settings and images at the same time - the sheet is created in MS Office
Which versions of PhpSpreadsheet and PHP are affected?
1.9.0 and previous versions
This worked for me
PROPOSED PATCH:
/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Rels.php
line: 200
ADD:
if (isset($unparsedLoadedData['sheets'][$pWorksheet->getCodeName()]['printerSettings'])&&is_array($unparsedLoadedData['sheets'][$pWorksheet->getCodeName()]['printerSettings'])) {
$d += count($unparsedLoadedData['sheets'][$pWorksheet->getCodeName()]['printerSettings']);
}
EXPLANATION:
If unparsed data contatains 'printerSettings' rise referenceID
NOT SURE if printerSettings have always referenceID=1, so the patch might not be universal
The text was updated successfully, but these errors were encountered: