Forum


Replies: 2   Views: 3440
Cannot add list to document: unhandled exception
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by larrytech  · 16-02-2015 - 10:36

PHPDOCX Pro: Version 4.5 I have an array of Word Fragments that I would like to add to another Word Fragment as a list. When I call: $excerptsFragment->addList($excerpts, 1); where $excerptsFragment is the parent Word Fragment, and $excerpts is the array of Word Fragments (one for each list item) I get the following exception: Declaration of CreateList::generatePSTYLE() should be compatible with CreateElement::generatePSTYLE($val = 'Textonotaa...') classes/CreateList.inc on line 427 What's the best way to resolve this? Thanks **Edit: There also appears to be a problem with generateStart(): Declaration of CreateList::generateSTART() should be compatible with CreateElement::generateSTART($x = '-198', $y = '0'). Manually updating the PHPDocX code so all inherited methods match their parent definitions fixes this.

Posted by admin  · 16-02-2015 - 11:48

Hello, Thanks for the tip, we have fixed it on the current dev version. Although note that it's not an error or exception but a Notice that you can hide in your PHP config. Regards.

Posted by larrytech  · 16-02-2015 - 12:30

Thanks for the reply! In case anyone is having similar problems, a lot of frameworks (we're using Laravel) will intercept notices and convert them to exceptions. You can disable this conversion in the configuration: http://stackoverflow.com/questions/18497788/laravel-breaks-entire-app-on-php-notices