[misc] Fix hack introduced by sdumitriu as a quick fix for the regression (XWIKI-10131) I introduced with XWIKI-8313.

(cherry picked from commit 69ce297a2c0fcaec42cbf4f36d7a7802eadae7ac)