Description
A Comment that sits inside a Group is written as a relationship to a part that is never written.
Writer\PowerPoint2007\PptSlides walks a slide with flattenShapes(), so it finds the comment and
writes ppt/slides/_rels/slideN.xml.rels with a relationship of type .../comments pointing at
../comments/commentN.xml. The four writers that were to answer for that relationship walk
getShapeCollection() flat instead and never see the comment:
| writer |
what it did not do |
PptComments |
write ppt/comments/commentN.xml |
ContentTypes |
declare the Override for that part |
CommentAuthors |
write ppt/commentAuthors.xml |
Relationships |
relate the author list from the presentation |
So the package goes out holding a relationship whose target is not in it.
Steps to reproduce
$presentation = new PhpPresentation();
$group = new Group();
$group->addShape(new Comment());
$presentation->getActiveSlide()->addShape($group);
(new PowerPoint2007($presentation))->save('group-comment.pptx');
Expected behavior
ppt/comments/comment1.xml is in the package, its content type is declared, and the author list is
written and related.
Current behavior
ppt/slides/_rels/slide1.xml.rels names ../comments/comment1.xml, and no such part exists.
PowerPoint asks to repair the file on open.
The same comment placed directly on the slide is written correctly, so only a comment inside a group
is affected. A group can hold a group, so the nesting is not one deep.
Description
A
Commentthat sits inside aGroupis written as a relationship to a part that is never written.Writer\PowerPoint2007\PptSlideswalks a slide withflattenShapes(), so it finds the comment andwrites
ppt/slides/_rels/slideN.xml.relswith a relationship of type.../commentspointing at../comments/commentN.xml. The four writers that were to answer for that relationship walkgetShapeCollection()flat instead and never see the comment:PptCommentsppt/comments/commentN.xmlContentTypesOverridefor that partCommentAuthorsppt/commentAuthors.xmlRelationshipsSo the package goes out holding a relationship whose target is not in it.
Steps to reproduce
Expected behavior
ppt/comments/comment1.xmlis in the package, its content type is declared, and the author list iswritten and related.
Current behavior
ppt/slides/_rels/slide1.xml.relsnames../comments/comment1.xml, and no such part exists.PowerPoint asks to repair the file on open.
The same comment placed directly on the slide is written correctly, so only a comment inside a group
is affected. A group can hold a group, so the nesting is not one deep.