Hack to fix bug 59780

Reverts changes from https://gerrit.wikimedia.org/r/#/c/40337 for TMH

Code needs rewriting and fixing properly as per bug 59780#c6

Bug: 59780
Change-Id: Ic69889e4646a769e1fc3eafbfe961e507f3b5a17
(cherry picked from commit d91fd4967526e5cad6025388cfa7865b41f705a7)