supress PHP notice – Undefined index for em-event.php
-
I was getting this notice messages while I was updating events posts,
... Notice: Undefined index: open-to-registration in /www/wp-content/plugins/events-manager/classes/em-event.php on line 512 Notice: Undefined index: lecturer1 in /www/wp-content/plugins/events-manager/classes/em-event.php on line 512 ...
This patch solved my problem,
--- a/em-event.php 2016-01-19 07:23:40.082602402 +0200 +++ b/em-event.php 2016-01-19 22:00:48.924255807 +0200 @@ -509,7 +509,7 @@ foreach($_POST['em_attributes'] as $att_key => $att_value ){ if( (in_array($att_key, $event_available_attributes['names']) || array_key_exists($att_key, $this->event_attributes) ) ){ $this->event_attributes[$att_key] = ''; - $att_vals = count($event_available_attributes['values'][$att_key]); + $att_vals = isset($event_available_attributes['values'][$att_key]) ? count($event_available_attributes['values'][$att_key]) : 0; if( !empty($att_value) ){ if( $att_vals <= 1 || ($att_vals > 1 && in_array($att_value, $event_available_attributes['values'][$att_key])) ){ $this->event_attributes[$att_key] = stripslashes($att_value);
can you please update it upstream ?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘supress PHP notice – Undefined index for em-event.php’ is closed to new replies.