- 🇵🇭Philippines dsdeiz
Yeah, experienced the same as well. For my case, it was because of the language. I wonder if it's a similar case.
Context condition for user was expecting the translated role names for "anonymous" and "authenticated" while context list only had untranslated role names.
I've attached the patch if that helps.
- 🇳🇱Netherlands cmseasy
I have a Dutch language site.
The patch did work for custum roles.
Not for anonymous (anonieme gebruiker) and authenticated (geverifieerde gebruiker). - 🇵🇭Philippines dsdeiz
Yeah, seems to work for my case. I tested with Dutch. You can try debugging using this:
@ plugins/context_condition_user.inc:38 @ class context_condition_user extends context_condition { function execute($account) { $all_roles = user_roles(); $users_roles = $account->roles; + print_r($all_roles); + print_r($users_roles); foreach ($all_roles as $rid => $role) { foreach ($this->get_contexts($role) as $context) { $options = $this->fetch_from_context($context, 'options');
- 🇨🇦Canada Ron Collins
Context was failing for anonymous users on the French pages after updating 3.11 to 3.12.
Patch #3 worked for me. Thanks.
Seems like an easy one to get rolled in for next release.
- Status changed to RTBC
about 1 year ago 3:40pm 17 November 2023 - 🇭🇺Hungary danyg Budapest
It's a simple and super solution for the issue, thanks. I can confirm the patch works when you translated the authenticated and/or anonymous role's name. Changed to RTBC
- Status changed to Needs review
4 months ago 9:26am 13 August 2024 - 🇪🇸Spain santiwww
Sometimes (depending on when and how drupal 7 was installed, p.e. after a migration from d6) the names in the roles table are already translated, and because of that the patch #3 does not work.
That's the case in some of my sites sites which were built in spanish in d6 and migrated to d7.
I have created a new patch to force the name in english for authenticated and anonymous roles.
I changed the status to needs review.