MDL-63973 core_badges: related badges query now works both ways