Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a situation where my anonymous users can have a different role than the standard anonymous user role (role id 1). In this case the front page by role doesn't work because its hard coded to use the settings for role id 1.
I'm using the Mobile Tools module and that module allows me to create a new role called "anonymous user (Mobile)". When a user visits the site using a mobile device they get this new role, which in my case has a role id of 5. Anonymous mobile users need to have a different front page than standard anonymous users.
Comment | File | Size | Author |
---|---|---|---|
#1 | front_page_916372.patch | 1.42 KB | bschilt |
Comments
Comment #1
bschilt CreditAttribution: bschilt commentedattached is a simple patch that uses the rid of the anonymous role instead of always using the role id 1.
Comment #2
bschilt CreditAttribution: bschilt commentedComment #3
pirmin CreditAttribution: pirmin commentedThe patch solved my issue where anonymous uid==2 although I copied/pasted the lines from the patch.
Before the patch, anonymous users would get a completely blank page.
Anonymous uid == 2 because the mysql backend is a replicating multi-multi db.
front_page.info
; $Id: front_page.info,v 1.13 2008/03/26 05:20:48 augustin Exp $
name = Front Page
description = Allows site admins setup custom front pages for the site.
package = Administration
; Information added by drupal.org packaging script on 2007-01-20
project = "front"
core = 6.x
; Information added by drupal.org packaging script on 2008-04-29
version = "6.x-1.2"
core = "6.x"
project = "front"
datestamp = "1209458407"
Comment #4
pgrond CreditAttribution: pgrond commentedJust applied the patch and it works. Had the same issue with mobile tools.
Comment #5
Simon Georges CreditAttribution: Simon Georges commentedSeveral roles are supported in the 6.x-2.x, please use this version if you want them.