Skip to content

Commit 9557dd9

Browse files
committed
FIXED : "Warning: Invalid error type specified in ...\PHPWord.php on line 226" is thrown when the specified template file is not found GH-32
1 parent 049c89d commit 9557dd9

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

Classes/PHPWord.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public function loadTemplate($strFilename) {
223223
$template = new PHPWord_Template($strFilename);
224224
return $template;
225225
} else {
226-
trigger_error('Template file '.$strFilename.' not found.', E_ERROR);
226+
trigger_error('Template file '.$strFilename.' not found.', E_USER_ERROR);
227227
}
228228
}
229229
}

Classes/PHPWord/Section/Footer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function addImage($src, $style = null) {
131131
$this->_elementCollection[] = $image;
132132
return $image;
133133
} else {
134-
trigger_error('Src does not exist or invalid image type.', E_ERROR);
134+
trigger_error('Src does not exist or invalid image type.', E_USER_ERROR);
135135
}
136136
}
137137

Classes/PHPWord/Section/Header.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function addImage($src, $style = null) {
131131
$this->_elementCollection[] = $image;
132132
return $image;
133133
} else {
134-
trigger_error('Src does not exist or invalid image type.', E_ERROR);
134+
trigger_error('Src does not exist or invalid image type.', E_USER_ERROR);
135135
}
136136
}
137137

@@ -189,7 +189,7 @@ public function addWatermark($src, $style = null) {
189189
$this->_elementCollection[] = $image;
190190
return $image;
191191
} else {
192-
trigger_error('Src does not exist or invalid image type.', E_ERROR);
192+
trigger_error('Src does not exist or invalid image type.', E_USER_ERROR);
193193
}
194194
}
195195

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
Fixed in branch for release 0.7 :
2626
- Bugfix: (RomanSyroeshko) GH-34 - PHPWord_Shared_String.IsUTF8 returns FALSE for Cyrillic UTF-8 input
27+
- Bugfix: (RomanSyroeshko) GH-32 - "Warning: Invalid error type specified in ...\PHPWord.php on line 226" is thrown when the specified template file is not found
2728
- Feature: (Progi1984) GH-1 - Implement RTF Writer
2829
- Feature: (Progi1984) GH-2 - Implement ODT Writer
2930
- Feature: (kaystrobach) - Word2007 : Add rowspan and colspan to cells

0 commit comments

Comments
 (0)