# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: Joomla root # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. --- administrator/components/com_comprofiler/controller/controller.users.php +++ administrator/components/com_comprofiler/controller/controller.users.php @@ -275,15 +275,17 @@ $userids[] = (int) $rows[$i]->id; $rows[$i]->note_count = 0; } - $query = "SELECT n.user_id, COUNT(n.id) AS note_count" + if ( $userids ) { + $query = "SELECT n.user_id, COUNT(n.id) AS note_count" . "\n FROM " . $_CB_database->NameQuote( '#__user_notes' ) . ' AS n' . "\n WHERE n.user_id IN (" . implode( ',', $userids ) .')' . "\n AND n.state >= 0" . "\n GROUP BY n.user_id"; - $_CB_database->setQuery( $query ); - $notes = $_CB_database->loadObjectList('user_id'); - for ( $i = 0; $i < $n; $i++ ) { - $rows[$i]->note_count = ( isset( $notes[$rows[$i]->id] ) ? $notes[$rows[$i]->id]->note_count : 0 ); \ No newline at end of file + $_CB_database->setQuery( $query ); + $notes = $_CB_database->loadObjectList('user_id'); + for ( $i = 0; $i < $n; $i++ ) { + $rows[$i]->note_count = ( isset( $notes[$rows[$i]->id] ) ? $notes[$rows[$i]->id]->note_count : 0 ); + } \ No newline at end of file } }