Redirect parent to newest child
Permalink 2 users found helpfulWhile logged in as Editor (not Admin, curiously enough)...
If you are on the newest child of the blog and click your back button, it logs you out.
If you are on the newest child of the blog and then click another link, it logs you out.
If you are on the newest child of the blog and click "Blog" again, it logs you out.
So, there is an issue with sessions, permissions and this add-on, it seems to me.
Thank you for reporting this, hopefully have it fixed soon.
I believe this is due to the page permissions for the editor user group you've created.
Depending on how you set your permissions the editor may have access to edit the blog parent page but no access for the blog entry ( child ) pages.
Are you using 'Advanced Permissions' ? Can you post your blog parent & blog entry page permissions setup ( even a screen shot will do ) ?
Screenshots are attached for the Blog parent and Blog Entry child pages.
Editor is checked for both viewer and editor groups.
If you feel like testing the advanced permissions it might be worth a shot, although I'm by no means an expert in this whole sessions/permissions department.
You can enable advanced permissions by including the following in your config/site.php
define('PERMISSIONS_MODEL', 'advanced');
I've setup a base install of concrete5.4.2.1 with the package ( base permissions ), added a user group called 'editor' and added a new user to the group. Works fine for me, no problems ( the user can visit the blog, get redirected automatically, and then use the browser back button ).
I'm wondering if you have your 'Edit Access' set for the 'editor' group to be able to edit the site. It's sorta of a master switch for groups to be able to edit on a site wide level... using advanced permissions does not have this 'switch'. You can find these settings in dashboard/settings/set_permissions/
attached is a screen shot of my settings in a working install with the default base permissions.
The only thing that I did was check the box next to the 'Editor' group as it was un-checked by default.
Hope you get it working, good news is that, so far, the problem is isolated and, as far as I can tell, not with the package itself...
So, I should probably add the advanced permissions to my site.php and see if that works, then?
I can take look at your setup if you want just private message me.
One hint to anyone using this (I think I am right), if you wish to change the page it redirects to, you need to change line 27 in models\page_redirect_to_newest_child.php from:
$pl->sortByPublicDateDescending();
to
by site map order
$pl->sortByDisplayOrder();
by name
$pl->sortByName();
Actually, it's technically a different addon, now called 'Page Auto Redirect' b/c you can select either the newest page, the first page in the site map, or a random page ( kinda fun, not sure if it's practical )
I'm attaching the package, I've tested with 5.5 works fine. Instead of installing a checkbox attribute it installs a select attribute for the selection.
Using Michael Krasnow's free 'Page Redirect' block, as a study reference, I've been able to create a package that installs a custom attribute 'Page Redirect To Newest Child' that when checked automatically redirects to the most recent child page. If no child page exists no redirect happens.
Just download the zip file... unzip into your packages directory... go to dashboard->add functionality , install the package.
Go to the page you want to redirect, add the newly created custom attribute 'Page Redirect To Newest Child' and make sure you check the box. At this point all requests to that page will be redirected to the newest child page. If you need to disable the redirect you must do so through the site map in the dashboard by accessing the page properties there.
Hope you like it,
Cheers,
Aaron
update: tested on c5 versions 5.4.1 & 5.4.2.1