joomla/joomla-cms — pull request #1017 by Bakual (2013-04-20 08:14:49+00:00)
Title: Fixing similar tags module query

Only group by m.core_content_id to avoid duplicates. Move "having" to "where", better to filter before grouping where it's possible.
Expanding the filter for the current item to also include the type_alias, otherwise items with the same id but from other extensions would be excluded as well.