2

I'm experiencing a strange issue that I'm having a really hard time debugging.

When I save a user account (of an authenticated user) as an admin, the account is saved, but when the page reloads I get an access denied and I am suddenly logged in as the user I saved, not the admin. This happens whether I save the account in the UI (via the People page) or save the account using a rules action.

Recently, I added a custom function and modified a few of my rules, so these changes are likely to be the cause of the problem. The site is version-controlled using git, so I can roll back to a working version, but I would like to attempt to determine what I did wrong.

I have Netbeans working with Xdebug. I just don't know where to set breakpoints or how otherwise to start looking for the source of this problem.

1 Answer 1

2

Can you re-produce the problem from CLI?

Using drush scr, bootstrap, login as user 1, save a new user, check if your ID changed.

If you can do this from CLI, git bisect can be very helpful in finding the commit that caused it.

2
  • 1
    Wow, I didn't know about drush scr. I will try to do this but first I will need to track down some examples. Commented Jun 29, 2013 at 13:46
  • It turns out you can't call user_load() from within hook_user_presave(). Commented Jun 30, 2013 at 5:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.