Welcome Guest, Not a member yet? Register   Sign In
Simple bug in Profiler's _compile_queries function
#1

[eluser]Unknown[/eluser]
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: http://bitbucket.org/ellislab/codeignite...le_queries

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:

Code:
$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:

Code:
$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>';


Messages In This Thread
Simple bug in Profiler's _compile_queries function - by El Forum - 07-22-2010, 12:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB