Title: Undefined array key &#8220;_user_id&#8221;
Last modified: October 21, 2024

---

# Undefined array key “_user_id”

 *  Resolved [peter8nss](https://wordpress.org/support/users/peter8nss/)
 * (@peter8nss)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/undefined-array-key-_user_id/)
 * I’m getting a PHP warning:
 *     ```wp-block-code
       Undefined array key "_user_id" in /home/sites/1a/4/44afcb079c/staging_html/wp-content/plugins/simple-history/inc/class-wp-rest-events-controller.php on line 743'
       ```
   
 * Think this relates to new line added in Changeset [3171877](https://plugins.trac.wordpress.org/changeset/3171877)(
   release 5.0.2). Unlike all the other nearby accesses to $context[‘_user_id’],
   this new one does not include “?? null”.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [davidacq](https://wordpress.org/support/users/davidacq/)
 * (@davidacq)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/undefined-array-key-_user_id/#post-18086484)
 * Same here having PHP warning after updating to 5.0.3.
   `PHP Warning: Undefined
   array key "_user_id" in /public_html/mysite/wp-content/plugins/simple-history/
   inc/class-wp-rest-events-controller.php on line 743`
    -  This reply was modified 1 year, 7 months ago by [davidacq](https://wordpress.org/support/users/davidacq/).
 *  Plugin Author [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * (@eskapism)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/undefined-array-key-_user_id/#post-18087590)
 * Yeah I get them too. I need to check why my tests does not pick up these.
 * Sorry about it – will fix in next version!
 *  Plugin Author [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * (@eskapism)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/undefined-array-key-_user_id/#post-18090506)
 * This should be fixed in the just released version 5.0.4.
 * I have also added more tests to catch errors like this in the future 🤞.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Undefined array key “_user_id”’ is closed to new replies.

 * ![](https://ps.w.org/simple-history/assets/icon.svg?rev=3225008)
 * [Simple History – Track, Log, and Audit WordPress Changes](https://wordpress.org/plugins/simple-history/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-history/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-history/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-history/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-history/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-history/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/undefined-array-key-_user_id/#post-18090506)
 * Status: resolved