webERP Forum

Full Version: 4.15 - PDFWOPrint.php Use of Undefined constant action Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm getting the following error trying to Print a Work Order in 4.15.

Notice: Use of undefined constant action - assumed 'action' in /share/MD0_DATA/Web/webERP/PDFWOPrint.php on line 314

Notice: Use of undefined constant action - assumed 'action' in /share/MD0_DATA/Web/webERP/PDFWOPrint.php on line 314

Notice: Undefined index: HTTPS in /share/MD0_DATA/Web/webERP/PDFWOPrint.php on line 476

Warning: Cannot modify header information - headers already sent by (output started at /share/MD0_DATA/Web/webERP/PDFWOPrint.php:314) in /share/MD0_DATA/Web/webERP/includes/tcpdf/tcpdf.php on line 7693
TCPDF ERROR: Some data has already been output to browser, can't send PDF file

Your help is appreciated.
Thanks for the report!

Can you try to change lines 314 and 316 from this:
PHP Code:
if ($RequirementsRow['autoissue']==0){
    
$WOLine[$i][action]='Manual Issue';  // line 314
} else {
    
$WOLine[$i][action]='Auto Issue';   // line 316


...to this?
PHP Code:
if ($RequirementsRow['autoissue']==0){
    
$WOLine[$i]['action']='Manual Issue';
} else {
    
$WOLine[$i]['action']='Auto Issue';


...and then change line 476 from this:
PHP Code:
    $Http $_SERVER['HTTPS']?'https://':'http://'

...to this?
PHP Code:
    $Http = !empty($_SERVER['HTTPS']) ? 'https://' 'http://'

Let me know if those work, I'll commit the changes later this week.

That should help the last error too, since the Notice output likely contributed to the "headers already sent" Warning message.
Your fix resolved the issue. Please commit. Thank you!
Changes committed.
Reference URL's