Update templatemap_generator.php

Another way to fix the real path
Merge pull request #4835 from ThaDafinser/patch-12

Update templatemap_generator.php
Merge branch 'hotfix/4835'

Close #4835
Fixes #4612