1 (edited by A.A 05/06/2018 11:46:26 am)

Topic: SQL code on web

Hi

There is some SQL code in the green field on the footer of web version like:

<div id='footer_debug'><div class='note_msg'><pre>SELECT name, value FROM 0_sys_prefs</pre>


<div id='footer_debug'><div class='note_msg'><pre>SELECT COUNT(*) FROM (SELECT IFNULL(a.gl_seq,0) as gl_seq,
                                gl.tran_date,
                                gl.type,
                                gl.type_no,
                                refs.reference,
                                SUM(IF(gl.amount>0, gl.amount,0)) as amount,
                                com.memo_,
                                IF(ISNULL(u.user_id),'',u.user_id) as user_id
                                FROM 0_gl_trans as gl
                                LEFT JOIN 0_audit_trail as a ON
                                                (gl.type=a.type AND gl.type_no=a.trans_no)
                                LEFT JOIN 0_comments as com ON
                                                (gl.type=com.type AND gl.type_no=com.id)
                                LEFT JOIN 0_refs as refs ON
                                                (gl.type=refs.type AND gl.type_no=refs.id)
                                LEFT JOIN 0_users as u ON
                                                a.user=u.id
                                WHERE gl.tran_date >= '2018-04-06'
                                AND gl.tran_date <= '2018-05-06'
                                AND gl.amount!=0 AND gl_seq=0 GROUP BY gl.tran_date, a.gl_seq, gl.type, gl.type_no) tmp_count</pre>

No difference where I am, they are everywhere, on the web, in the reports.

I don't know how they get there. Please tell me how can I fix it.

thank you so much.

Re: SQL code on web

"It's not a bug, it's a feature"

Please compare your config.php with config.default.php and this will reveal why every page shows the sql queries.

Re: SQL code on web

It appears that you have some of the debug parameters in your config.php file turned on - turn them off to get rid of these outputs.

This last specific SQL comes from the function get_sql_for_journal_inquiry() in gl/includes/db/gl_db_trans.inc.