We had a problem where blocks created in Drupal (but not those created by modules) and assigned visibility by role were disappearing on node create/edit pages and certain pages created by views. Eventually by eliminating modules one at a time, we drilled it down to the me module. It seems that on these pages Drupal was unable to get the role properly and showed the page as it should to anonymous users, i.e. without navigation.

After looking at the module code I had a hunch that the me validator was the problem so I went into one of the two views we were using it in to play around. I enabled the option to redirect the %me argument to the user id. This completely broke every url on the site - Firefox complained that it was hitting a circular redirect. I reversed the change in the database and got the site back.

Next I tried disabling the me validator and using the default user validator instead. This fixed all our problems. It looks like the validator is broken in such a way that it affects not only the views it is being used in but potentially any page on the site, especially where blocks are restricted by role.

I'd like to be able to provide a patch but we have spent a disproportionate amount of time on this issue already. However if you need more information I will be happy to try and provide it.

I've marked the bug critical as the Drupal guidelines say to do that for block visibility issues.

Comments

manuel.adan’s picture

I have just the same issue here, I found it only occurs when "Restrict user based on role" is activated.

dabblela’s picture

Me module definitely does something to the user's roles; if you have devel installed you can see it in the user global. For instance, the $roles array should look something like

$user->roles = array(
2 => 'authenticated user',
4 => 'Role #4'
);

whereas now it is using the array keys as the array values:

$user->roles = array(
0 => 2,
1 => 4,
);

On my site, db_rewrite_sql is looking for incorrect RIDs (0 instead of 2 or 1 instead of 4) so node access is not functioning correctly.