CodeIgniter Forums
Simple bug in Profiler's _compile_queries function - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Simple bug in Profiler's _compile_queries function (/thread-32419.html)

Simple bug in Profiler's _compile_queries function - El Forum - 07-22-2010

Hi guys,

I've been using CI for a few months now and love it. This is my first contribution, however small!

The bug is very easy to fix and I already submitted an issue for it on bitbucket:

Is there more I can do to get this simple fix into the next release?

Here's the details copied from the issue:

The _compile_queries function grabs all the database objects and then goes through the queries for each them, generating output. However, in the function that generates the output for each database is still using $this->CI->db->queries instead of $db->queries to output the query count.

This causes errors in the profiler when more than one database is in use.

To fix it change Profiler line 188:

$output .= '<legend style="color:<<issue 0000>>FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_database').':&nbsp; '.$db->database.'&nbsp;&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').': '.count($this->CI->db->queries).'&nbsp;&nbsp;&nbsp;</legend>';

Should be changed to:

$output .= '<legend style="color:<<issue 0000>>FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_database').':&nbsp; '.$db->database.'&nbsp;&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').': '.count($db->queries).'&nbsp;&nbsp;&nbsp;</legend>';