Call to a member function userGivenName() on null?.

  • Hello,

    I'm having a weird issue – it's generating error log messages, but it appears that the admin is working fine.

    The error is:


    1. "Call to a member function userGivenName() on null" at [...]perch/core/runway/apps/content/async/get-lock.php line 39

    It appears to occur when I save a piece of content, for example at the URL:


    1. /perch/core/apps/content/edit/?id=12"

    I'm using a custom auth plugin. Looking in the content_locks table, the userID is 0.

    The immediate trace is:


    1. "[...]perch/core/lib/api/PerchAPI_AuthPlugin.class.php:69",
    2. "[...]perch/core/lib/PerchUsers.class.php:32",
    3. "[...]perch/core/inc/auth_light.php:14",
    4. "[...]perch/core/runway/apps/content/async/get-lock.php:6"

    My resume_session method returns an array (as per the docs with keys email and role.

    As far as I can tell, if it can't get a lock, then it's looking for a PerchUser object which (obviously) it doesn't have.

    Am I doing something wrong?