bugfix: orHaving does not work when used as first having condition.
Merge pull request #5875 from benti/4.2-orhaving

[4.2] Fixed orHaving
Merge branch '4.2'