Warnings shown in GLCashFlowsIndirect.php - 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: Warnings shown in GLCashFlowsIndirect.php (/showthread.php?tid=2962) |
Warnings shown in GLCashFlowsIndirect.php - PakRicard - 01-03-2017 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. RE: Warnings shown in GLCashFlowsIndirect.php - TimSchofield - 01-03-2017 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 RE: Warnings shown in GLCashFlowsIndirect.php - PakRicard - 01-05-2017 Thanks Tim. Fixed and commited. RE: Warnings shown in GLCashFlowsIndirect.php - PakRicard - 01-06-2017 Also thanks to Rafael, who commited the bit I forgot :-) RE: Warnings shown in GLCashFlowsIndirect.php - Rafael Chacón - 01-07-2017 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. RE: Warnings shown in GLCashFlowsIndirect.php - TimSchofield - 01-07-2017 Simple answer Rafael is yes :-) Tim RE: Warnings shown in GLCashFlowsIndirect.php - PakRicard - 01-09-2017 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. RE: Warnings shown in GLCashFlowsIndirect.php - TimSchofield - 01-12-2017 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 RE: Warnings shown in GLCashFlowsIndirect.php - PakRicard - 01-13-2017 (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. Thanks Tim. I misunderstood the issue, then. RE: Warnings shown in GLCashFlowsIndirect.php - Rafael Chacón - 01-14-2017 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. |