Cron checks for a user's last password reset date and when the password should expire. Currently the code reads:

      $user_last_reset = $user->get('field_last_password_reset')->get(0)->getValue();
...
      $user_expired = $user->get('field_password_expiration')->get(0)->getValue();

This throws an error about use of a member function where it's not possible to use it (getValue()). Unsure exactly what the error was, I fixed it and refreshed ;)

Patch attached to resolve the issue - it's a single-value field so you shouldn't need to do ->get(0) on it.

Comments

Sophie.SK created an issue. See original summary.

sophie.sk’s picture

StatusFileSize
new1015 bytes

Patch attached.

nerdstein’s picture

Assigned: Unassigned » nerdstein

Thanks, I'll pull this down and give it a test drive.

nerdstein’s picture

Status: Needs review » Patch (to be ported)
StatusFileSize
new2.95 KB

The patch was generated relative to the docroot and not the module. I had to clean it up.

Since I was in there, I removed some deprecated functions and added some annotations in to make the code more readable.

Attached is a new patch, which was already tested and will be merged into 8.x-3.x.

nerdstein’s picture

Status: Patch (to be ported) » Fixed

Pushed

  • nerdstein committed ee8601c on 8.x-3.x
    Issue #2676310 by Sophie.SK, nerdstein: Incorrect use of member function...

Status: Fixed » Closed (fixed)

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