On sites using Content Profile, RealName, Password Policy, and an administration theme, the blocks administration page will sometimes only be displayed in the administration theme... it's not possible to select any other enabled theme.

Troubleshooting this issue led me to #219910: Calling theme function from hook_init() interferes with administration theme and then to #467492: realname_make_name, theme, block configuration (specifically comment #5). Basically, when the theme system is initialized too early, blocks administration gets stuck on the admin theme and can't load any other theme.

A backtrace of RealName's realname_user() led me to password_policy_init(), which I discovered is using user_load() to get the value of 'force_password_change', and user_load() causes the theme to be loaded.

I've attached a patch that does away with user_load() and simply queries the value of 'force_change' for the user from the database directly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

erikwebb’s picture

Status: Needs review » Postponed (maintainer needs more info)

There isn't a reason that user_load() should inherently start the theme system. Isn't this an issue that Real Name is starting the process too early rather than Password Policy?

ChrisLaFrancis’s picture

From what I understand, when Content Profile supplies the fields for RealName, the fields in the profile content type are formatted, and the formatting uses theme-related functions and thus loads the theme. I'm not sure if there's any way around that.

erikwebb’s picture

Title: user_load() in password_policy_init() can cause problems with blocks admin » user_load() in hook_init() can cause problems with blocks admin
Project: Password Policy » Real Name

I would argue that RealName should not be doing this. I'll forward this issue over to their queue and see what they think.

Dave Reid’s picture

Huh? How is realname in the wrong here?

erikwebb’s picture

Should user_load() be triggering the theme system? It seems like an unnatural connection.

hass’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)