Forum


Replies: 4   Views: 1157
Importstyles issue
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  · 29-03-2021 - 11:52

Hello,

Please apply the following minor change and try again:

  1. Edit Classes/Phpdocx/Create/CreateDocx.php and go to that line (7196).
  2. Add the following code:
if (!isset($name)) {
  $name = 'nl' . $listId;
}

before line 7196.

This is the code to be used after applying the previous change:

$listStyleXML = str_replace('<w:abstractNum w:abstractNumId="0"', '<w:abstractNum w:abstractNumId="' . $originalAbstractNumId . '"', $listStyleXML);
if (!isset($name)) {
  $name = 'nl' . $listId;
}
self::$customLists[$name]['id'] = $listId;
self::$customLists[$name]['wordML'] = $listStyleXML;

It seems you are trying to import a custom paragraph style with a numbering style and $name is not being initializated, so you are getting that PHP notice. The previous code generates a random one when $name is not set. We have moved the post to the dev team to consider including this same change.

Regards.