Fix to the exports not working since the new pivoting

- Helper echoed a blank line, breaking the xml export

- Helper will now only be called during view when it's not a rest request.
Merge branch 'hotfix-2.1.22'