Last change to the BIG query used in load_user_capability() has changed the GROUP BY sentence leaving some of the fields in the SELECT list out:
From the first part of the query:
missing ----> (c1.contextlevel * 100)
From the second part of the query:
need table prefix ----> id1, id2
missing ----> (c1.contextlevel * 100 + c2.contextlevel)
It's 100% mandatory to group by ALL the fields (expresions) in the SELECT list.
I'm going to add them to the query right now in order to allow Moodle HEAD to work but I'm not sure if that's the desired logic and order of grouping desired. Please review it!!