Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
order status report
12-19-2017, 10:16 AM (This post was last modified: 12-20-2017 01:14 PM by rjonesbsink.)
Post: #1
order status report
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.
Find all posts by this user
Quote this message in a reply
12-19-2017, 10:18 AM (This post was last modified: 12-19-2017 10:45 AM by TurboPT.)
Post: #2
RE: order status report
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?
Find all posts by this user
Quote this message in a reply
12-19-2017, 10:45 AM (This post was last modified: 12-19-2017 11:20 AM by rjonesbsink.)
Post: #3
RE: order status report
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
Find all posts by this user
Quote this message in a reply
12-20-2017, 08:00 AM (This post was last modified: 12-20-2017 08:03 AM by TurboPT.)
Post: #4
RE: order status report
@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.
Find all posts by this user
Quote this message in a reply
12-20-2017, 08:25 AM
Post: #5
RE: order status report
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
Visit this user's website Find all posts by this user
Quote this message in a reply
12-20-2017, 09:20 AM
Post: #6
RE: order status report
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.
Find all posts by this user
Quote this message in a reply
12-20-2017, 09:24 AM (This post was last modified: 12-20-2017 09:49 AM by TurboPT.)
Post: #7
RE: order status report
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.
Find all posts by this user
Quote this message in a reply
12-20-2017, 01:08 PM (This post was last modified: 12-20-2017 01:10 PM by rjonesbsink.)
Post: #8
RE: order status report
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.


Attached File(s)
.php  PDFOrderStatus.php (Size: 14.52 KB / Downloads: 3)
Find all posts by this user
Quote this message in a reply
12-20-2017, 01:25 PM
Post: #9
RE: order status report
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.
Find all posts by this user
Quote this message in a reply
12-20-2017, 01:41 PM (This post was last modified: 12-20-2017 02:03 PM by rjonesbsink.)
Post: #10
RE: order status report
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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)