Fix bug when generating permalinks as admin
Merge branch 'viewer-edit-mode'

* viewer-edit-mode:
  Fix bug when generating permalinks as admin