Fixes exception when accesing request.current_page within apphook view.

Fixes #1890