Forum


Replies: 4   Views: 1508
Domnode::insertbefore(): document fragment is empty
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 admin  · 13-11-2020 - 07:09

Hello,

Thanks for sending the requested code. The issue in your script is the one explained in our previous reply. You are mixing a HTML with two list types: one that applies a custom list style and other without it. To avoid the warning, please apply the following minor change that will be added to the next release of phpdocx:

  • Edit CreateDocx.php (classes folder using the classic package).
  • Go to the embedHTML method, and around line 5539 of the classic package, you'll find the following line:
$this->_wordNumberingT = $this->importSingleNumbering($this->_wordNumberingT, self::$customLists[$value['name']]['wordML'], $value['id'], $abstractNumId, true);

You need to replace it by:

if (isset(self::$customLists[$value['name']]['wordML'])) {
    $this->_wordNumberingT = $this->importSingleNumbering($this->_wordNumberingT, self::$customLists[$value['name']]['wordML'], $value['id'], $abstractNumId, true);
}

After this minor change the warning will disappear and you can use both style types (custom and auto generated) in the same HTML.

Regards.