CON-1239 | fixed MySQL query (some wikis gave NULLs)