Fixes #3482, apply quick fix so Piwik works when ranking query is disabled and added test for disabled ranking query. Added FIXME comment to make sure underlying issue is eventually dealt with.