Patches to fix user redirect on view.php