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.
What is the script name that causes this error?MiscFunctions.phpIS 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.
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.phpIS 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.
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.
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
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.
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.
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.
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)