This might too much of an edge case for most people, but we have a cron job which synchronises user accounts from a remote server. When an account has a role which matches the password policy we have setup (accounts with certain admin roles only), and the account is due for a password expiry, password_policy_user_update() creates a watchdog message. This message assumes the active user is a real person, which isn't the case during cron, and so $user->name does not exist and causes an extra watchdog message.

The attached patch fixes this by providing an alternative watchdog message when the global uid is zero.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

paulbeaney created an issue. See original summary.

AohRveTPV’s picture

Status: Active » Needs review

Setting to 'Needs review' to run automated tests.

AohRveTPV’s picture

Added a comment to explain the !$user->uid condition. Going to go ahead and commit if tests pass, but please let me know if it is inaccurate.

Reading the Password Policy code I have often wondered the purpose of various conditions so I want to make sure to document them going forward.

AohRveTPV’s picture

Version: 7.x-1.12 » 7.x-1.x-dev

  • AohRveTPV committed 6129eca on 7.x-1.x authored by paulbeaney
    Issue #2622934 by AohRveTPV, paulbeaney: Updates to user account during...
AohRveTPV’s picture

Status: Needs review » Needs work
AohRveTPV’s picture

It tested the D6 patch on D7 for some reason. Retesting. Maybe you can't change the version in the same comment as you set a patch to 'Needs review', if you want the tests to run on the new version.

AohRveTPV’s picture

Neither 7.x-2.x nor 8.x-3.x generate a notice like this one, so this change in non-applicable to those branches.

  • AohRveTPV committed 5e39060 on 6.x-1.x authored by paulbeaney
    Issue #2622934 by AohRveTPV, paulbeaney: Updates to user account during...
AohRveTPV’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.