webERP Forum
4.15 - PDFWOPrint.php Use of Undefined constant action Error - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (http://www.weberp.org/forum/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (http://www.weberp.org/forum/forumdisplay.php?fid=8)
+--- Thread: 4.15 - PDFWOPrint.php Use of Undefined constant action Error (/showthread.php?tid=8233)



4.15 - PDFWOPrint.php Use of Undefined constant action Error - William Hunter - 11-06-2018

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.


RE: 4.15 - PDFWOPrint.php Use of Undefined constant action Error - TurboPT - 11-06-2018

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.


RE: 4.15 - PDFWOPrint.php Use of Undefined constant action Error - William Hunter - 11-06-2018

Your fix resolved the issue. Please commit. Thank you!


RE: 4.15 - PDFWOPrint.php Use of Undefined constant action Error - TurboPT - 11-07-2018

Changes committed.