Forum


Replies: 2   Views: 1606
Crash - undefined index: border_top_width
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 vpratfr  · 06-07-2020 - 09:29

Thanks, I'll check my stylesheet, I don't want to ignore PHP warnings.

Your code reads

// file: "./packages/phpdocx/Classes/Phpdocx/Transform/HTML2WordML.php"
// line: 2198

if (isset($properties['border_' . $value . '_style']) 
    && $properties['border_' . $value . '_color'] != 'none' 
    && $properties['border_' . $value . '_width'] != null)

It would be safe to add a `isset($properties['border_' . $value . '_width']) ` to get rid of that warning. Additionally, there should be a default width set anyway by the Docx creator.

// file: "./packages/phpdocx/Classes/Phpdocx/Transform/HTML2WordML.php"
// line: 2198

if (isset($properties['border_' . $value . '_style']) 
    && isset($properties['border_' . $value . '_color']) 
    && isset($properties['border_' . $value . '_width']) 
    && $properties['border_' . $value . '_color'] != 'none' 
    && $properties['border_' . $value . '_width'] != null)