Keyword

mod_k2_comments Top Commenter SQL Error

  • Kaye Patrick
  • Kaye Patrick's Avatar Topic Author
  • Offline
  • New Member
More
14 years 8 months ago #71178 by Kaye Patrick
mod_k2_comments Top Commenter SQL Error was created by Kaye Patrick
When set to option Top Commenters in backend module parameters, mod_k2_comments throws up an ugly SQL error.

This can be fixed by modifying /modules/mod_k2_comments/helper.php as follows:

around line 111, find

$query = "SELECT COUNT(id) as counter, userName, userID, commentEmail FROM #__k2_comments"." WHERE userID > 0"." AND published = 1";
" GROUP BY userID ORDER BY counter DESC";

and replace with

$query = "SELECT COUNT(id) as counter, userName, userID, commentEmail FROM #__k2_comments"." WHERE userID > 0"." AND published = 1"." GROUP BY userID ORDER BY counter DESC";

this replaces one semicolon with a period before "GROUP BY"

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum