Title: PHP Notice: Undefined variable: set_post_name
Last modified: August 29, 2017

---

# PHP Notice: Undefined variable: set_post_name

 *  Resolved [Sylvain Tissot](https://wordpress.org/support/users/stissot/)
 * (@stissot)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/php-notice-undefined-variable-set_post_name/)
 * When publishing an event that was previously saved as draft, at the time of clicking
   the Publish button, we encounter the error
 *     ```
       Notice: Undefined variable: set_post_name in wp-content/plugins/events-manager/classes/em-event.php on line 1154
       Warning: Cannot modify header information - headers already sent by (output started at wp-content/plugins/events-manager/classes/em-event.php:1154) in wp-admin/post.php on line 197
       Warning: Cannot modify header information - headers already sent by (output started at wp-content/plugins/events-manager/classes/em-event.php:1154) in wp-includes/pluggable.php on line 1210
       ```
   
 * WordPress 4.8.1, PHP 7.0, events-manager 4.8.1 (r1720673), free version.
 * I managed to temporary fix the problem by adding at line 1174 in function `set_status()`
   in `classes/em-event.php`:
 * `$set_post_name = false;`
 * I wanted to submit a pull request. How can we contribute to the code? Why does`
   events-manager` is still using SVN and didn’t move to GitHub?

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

 *  Plugin Support [angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
 * (@angelo_nwl)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/php-notice-undefined-variable-set_post_name/#post-9453804)
 * can you try to upgrade to the latest EM version?
 *  Thread Starter [Sylvain Tissot](https://wordpress.org/support/users/stissot/)
 * (@stissot)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/php-notice-undefined-variable-set_post_name/#post-9453878)
 * Sorry my mistake I already use EM 5.7.3 which is the latest at the time of writing
 *  Plugin Support [angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
 * (@angelo_nwl)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/php-notice-undefined-variable-set_post_name/#post-9488903)
 * can you try to upgrade to the latest EM dev version 5.7.3.3? to upgrade to the
   latest dev version, you can go to events > settings > general > admin tools
 *  Thread Starter [Sylvain Tissot](https://wordpress.org/support/users/stissot/)
 * (@stissot)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/php-notice-undefined-variable-set_post_name/#post-9489138)
 * After upgrading to EM dev 5.7.3.3, I have now the following error when publishing
   an event that was previously saved as a draft.
 * `Warning: Invalid argument supplied for foreach() in wp-content/plugins/events-
   manager/classes/em-bookings.php on line 287`
 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/php-notice-undefined-variable-set_post_name/#post-9489823)
 * Is this in addition to the other error message or instead of it?
 * It’s possible this is a conflict caused by your theme or another plugin. To check
   if it is, can you test with all other plugins deactivated and while running the
   default WordPress theme?

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

The topic ‘PHP Notice: Undefined variable: set_post_name’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=1039078)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/php-notice-undefined-variable-set_post_name/#post-9489823)
 * Status: resolved