Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Warnings shown in GLCashFlowsIndirect.php
01-03-2017, 01:59 PM
Post: #1
Warnings shown in GLCashFlowsIndirect.php
Hi all:
Just merged webERP commit 7715 and found that GLCashFlowsIndirect.php is showing the following warnings:

Strict Standards: Only variables should be passed by reference in /home/mydomain.com/GLCashFlowsIndirect.php on line 79

Strict Standards: Only variables should be passed by reference in /home/mydomain.com/GLCashFlowsIndirect.php on line 80

Strict Standards: Only variables should be passed by reference in /home/mydomain.com/GLCashFlowsIndirect.php on line 100

Strict Standards: Only variables should be passed by reference in /home/mydomain.com/GLCashFlowsIndirect.php on line 109

Strict Standards: Only variables should be passed by reference in /home/mydomain.com/GLCashFlowsIndirect.php on line 468

Strict Standards: Only variables should be passed by reference in /home/mydomain.com/GLCashFlowsIndirect.php on line 485

It is the first time I used this script, so not sure since which commit it shows the warnings.

Regards,
Pak Ricard
Find all posts by this user
Quote this message in a reply
01-03-2017, 06:17 PM
Post: #2
RE: Warnings shown in GLCashFlowsIndirect.php
Hi Ricard, it is caused by the DB_query() function being inside the call to the DB_fetch_array() function. eg DB_fetch_array(DB_query("some sql"));

Strictly speaking the & before the variable in the declaration of the functions in ConnectDB_XXXX.inc should be removed as it is obsolete in modern versions of PHP.

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
01-05-2017, 10:13 AM
Post: #3
RE: Warnings shown in GLCashFlowsIndirect.php
Thanks Tim. Fixed and commited.

Regards,
Pak Ricard
Find all posts by this user
Quote this message in a reply
01-06-2017, 03:54 PM
Post: #4
RE: Warnings shown in GLCashFlowsIndirect.php
Also thanks to Rafael, who commited the bit I forgot :-)

Regards,
Pak Ricard
Find all posts by this user
Quote this message in a reply
01-07-2017, 01:19 AM
Post: #5
RE: Warnings shown in GLCashFlowsIndirect.php
Hi,

You are welcome Pak Ricard. For future reference: Commit [r7717]: For strict Standards, removes the "&" before the variable in DB_fetch_row() and in DB_fetch_array() in ConnectDB_XXX.inc. Thanks Tim. (https://sourceforge.net/p/web-erp/code/7717/).

Should we remove the rest of "&" before the variable in ConnectDB_XXX.inc?

Best regards, Rafael.

Rafael E. Chacón
Verdorama
http://www.verdorama.com
Visit this user's website Find all posts by this user
Quote this message in a reply
01-07-2017, 02:18 AM
Post: #6
RE: Warnings shown in GLCashFlowsIndirect.php
Simple answer Rafael is yes :-)

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
01-09-2017, 06:20 PM
Post: #7
RE: Warnings shown in GLCashFlowsIndirect.php
Hi Rafael:

I just realized that your commit 7719 rollback the changes commited in 7716 about the warnings I found in this script. Did you find some side effect and decided to rollback?

Thanks.

Regards,
Pak Ricard
Find all posts by this user
Quote this message in a reply
01-12-2017, 08:07 PM
Post: #8
RE: Warnings shown in GLCashFlowsIndirect.php
Hi Ricard, I am not sure whether Rafael intended to rollback those changes however making the changes in the ConnectDB_XXXX.inc files means that the changes in the script are not strictly necessary. However personally I prefer the statements to be split on separate lines as is usual in webERP, but thats just a personal preference.

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
01-13-2017, 10:06 AM
Post: #9
RE: Warnings shown in GLCashFlowsIndirect.php
(01-12-2017 08:07 PM)falkoner Wrote:  Hi Ricard, I am not sure whether Rafael intended to rollback those changes however making the changes in the ConnectDB_XXXX.inc files means that the changes in the script are not strictly necessary. However personally I prefer the statements to be split on separate lines as is usual in webERP, but thats just a personal preference.

Tim

Thanks Tim. I misunderstood the issue, then.

Regards,
Pak Ricard
Find all posts by this user
Quote this message in a reply
01-14-2017, 03:15 AM
Post: #10
RE: Warnings shown in GLCashFlowsIndirect.php
Hi Ricard,

The problem was caused by the operator "&" before the variable in DB_fetch_row() and in DB_fetch_array() in ConnectDB_XXX.inc. Using multiples lines (multiples variables) solves the way the last variable is seen by PHP (in strict mode) but not solves the problem itself.

When we remove the "&" before the variable in DB_fetch_row() and in DB_fetch_array() in ConnectDB_XXX.inc (commit r7717), we solved the problem here and in other scripts.

I restored the "compact" code because I prefer to simplify the code to easy understand (less lines, less variables, less steps) and to have a"very little" less use of resources.

Best regards, Rafael.

Rafael E. Chacón
Verdorama
http://www.verdorama.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


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