issue #20332: fixed a listrelationsbox bug

The fix was in the orm, but I went ahead and wrote a mocha test to see if that bug (or similar ones) existed anywhere else in other listrelationsboxes. It uncovered about five more bugs, which I also fixed.