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

Iterator throw fatal error #33

Open
sadjehwty opened this issue Jun 6, 2019 · 0 comments
Open

Iterator throw fatal error #33

sadjehwty opened this issue Jun 6, 2019 · 0 comments

Comments

@sadjehwty
Copy link

This simple code
$odf = new Odf('./test.odt');
for($i=0;$i<2;$i++){
$index = $odf->setSegment('index');
$iter=$index->getIterator();
foreach($iter as $s){
print_r($s->getName());
echo "\n";
}
}

throw a fatal error

Fatal error: Uncaught exception 'SegmentException' with message 'child children does not exist' in
cybermonde\odtphp\library\Segment.php:198

Stack trace:
#0 vendor\cybermonde\odtphp\library\SegmentIterator.php(36): Segment->__get('children')
#1 test.php(7): SegmentIterator->getChildren()
#2 {main} thrown in vendor\cybermonde\odtphp\library\Segment.php on line 198

In original odtphp.com version SegmentIterator@36 was return new self($this->current()->getChildrens()); not return new self($this->current()->children);
With the original code there are no fatal errors

test.odt:
[!-- BEGIN index --][!-- BEGIN c1 --][!-- END c1 --][!-- BEGIN c2 --][!-- END c2 --][!-- END index --]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant