webERP Forum
order status report - 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: order status report (/showthread.php?tid=7997)

Pages: 1 2


order status report - rjonesbsink - 12-19-2017

Fatal error: Cannot redeclare prnMsg() (previously declared in C:\xampp\htdocs\weberp\includes\MiscFunctions.php:8) in C:\xampp\htdocs\weberp\includes\includes\MiscFunctions.php on line 12

pops up when clicking create pdf

looked at the lines and here is what they show

(line8) function prnMsg($Msg,$Type='info', $Prefix=''){

echo getMsg($Msg, $Type, $Prefix);

(line12 of the other file) is the same as line 8 in the first file.



RE: order status report - TurboPT - 12-19-2017

What is the script name that causes this error?
MiscFunctions.php IS the script where prnMsg() is defined. (and the one that should be used across the app)

I need to know what other script [hover the link to see in the status bar] that is trying to redefine that function.

Meanwhile, I'll do a search as it should be easy to locate.
Did a search and also checked the PDFOrderStatus.php script, and I cannot find any other 'redeclare' of that function.

Is there some other script to know?


RE: order status report - rjonesbsink - 12-19-2017

when I try to run the order status report. this is what I got

(12-19-2017, 10:18 AM)TurboPT Wrote: What is the script name that causes this error?
MiscFunctions.php IS the script where prnMsg() is defined. (and the one that should be used across the app)

I need to know what other script [hover the link to see in the status bar] that is trying to redefine that function.

Meanwhile, I'll do a search as it should be easy to locate.
Did a search and also checked the PDFOrderStatus.php script, and I cannot find any other [re]definition of that function.

Is there some other script to know?


@phil or @tim




RE: order status report - TurboPT - 12-20-2017

@rjones:

I did find one point where there might be a "double include" situation.

Strange that I don't get/see the same error, but in the PDFOrderStatus.php script, can you try commenting-out line 89 to see of that helps the situation for you?

Assuming that you don't have any locally applied changes, line 89 has this entry:
PHP Code:
include('includes/ConnectDB.inc'); 

That file is included at another point before that line.


RE: order status report - falkoner - 12-20-2017

Hi Paul, you are right this is the problem, and I am not sure why that line is in there. I a guessing you (and I) don't see this error because ConnectDB.php uses the require_once() function to include it, so as it is already included it will just get ignored. My guess is (I haven't the time to do research) that the original poster has some setting in his PHP which is throwing up a warning here, that warning is getting sent to the browser and so is stopping TCPDF from creating the report.

Anyway the proper solution is the one you suggest.
Tim


RE: order status report - rjonesbsink - 12-20-2017

tried your solution and it did not work.


(12-20-2017, 08:00 AM)TurboPT Wrote: @rjones:

I did find one point where there might be a "double include" situation.

Strange that I don't get/see the same error, but in the PDFOrderStatus.php script, can you try commenting-out line 89 to see of that helps the situation for you?

Assuming that you don't have any locally applied changes, line 89 has this entry:
PHP Code:
include('includes/ConnectDB.inc'); 

That file is included at another point before that line.




RE: order status report - TurboPT - 12-20-2017

Make sure that you start from the Order Status link again instead of a page refresh.

If that still does not work, can you attach your copy of PDFOrderStatus.php, so that I can try it?

Also, what does the line with MiscFunctions.php look like inside file ConnectDB.inc ? (should be around line 9-ish)
@Tim: He is actually getting a Fatal error on a redeclare, not a warning ... please double check the first post.


RE: order status report - rjonesbsink - 12-20-2017

I added it with out the solution you suggested. and line 9 in the connectdb.inc shows require_once ($PathPrefix .'includes/MiscFunctions.php');

(12-20-2017, 09:24 AM)TurboPT Wrote: Make sure that you start from the Order Status link again instead of a page refresh.

If that still does not work, can you attach your copy of PDFOrderStatus.php, so that I can try it?

Also, what does the line with MiscFunctions.php look like inside file ConnectDB.inc ? (should be around line 9-ish)
@Tim: He is actually getting a Fatal error on a redeclare, not a warning ... please double check the first post.




RE: order status report - TurboPT - 12-20-2017

Ok, on the line 9.

The script works for me. (both with and without the change suggested earlier)

Are you able to search the entire code base?

If so, search for the string: "function prnMsg" ... there should only be one instance found, inside the MiscFunctions.php file.

If you are on Linux, I can give a find command to do the search.

Other than that, I'm not sure what else to check at the moment.



RE: order status report - rjonesbsink - 12-20-2017

i use windows and notepad++ and when i looked and searched in that file only 1 time did that function was found. when i searched the entire weberp folder for the function prnMsg here is what i found and where)

C:\xampp\htdocs\weberp\doc\change.log (line 1709)
C:\xampp\htdocs\weberp\includes\change.log (line 1709)
C:\xampp\htdocs\weberp\includes\includes\MiscFunction.php (line 8)
C:\xampp\htdocs\weberp\includes\MiscFuctions.php (line 8)
C:\xampp\htdocs\weberp\webErp\doc\change.log (line 1709)
C:\xampp\htdocs\weberp\webErp\includes\MiscFunctions (line 8)


(12-20-2017, 01:25 PM)TurboPT Wrote: Ok, on the line 9.

The script works for me. (both with and without the change suggested earlier)

Are you able to search the entire code base?

If so, search for the string: "function prnMsg" ... there should only be one instance found, inside the MiscFunctions.php file.

If you are on Linux, I can give a find command to do the search.

Other than that, I'm not sure what else to check at the moment.