Say John Doe requests page
http://siteurl/index.php?id=77, but John forgot to log in, so that page is locked for him. He gets an error page. John logs in to get to the page, but gets redirected to the mainpage.
This is annoying for users. And even when specifying
liHomeId in the WebloginPE snippet call it won’t work. The url in the browser will show the url requested, but
liHomeId will be equal to the error page ID, as will [*id*]. How do we fix this?
There is a quick and dirty way to fix this, we have to ’hack’ WebloginPE a little bit.
-Open the WebloginPE snippet
-Find
$loHomeId = isset($loHomeId) ? $loHomeId : '';
-On the row above it add the following code:
$liHomeId = $modx->stripTags($modx->db->escape($_GET['id']));
This will get the id used in the url, and when the user logs in will send him right back to the page he requested. (It will also strip HTML and MODx tags and escape SQL for some basic security)
This may not be the ideal solution for this problem, and I would not advise to use it in live productions. There was 15 minutes of thinking invested in it so it could be done way better and more secure then right now. I just thought to share this so people have a workaround for this problem.