• I have this strange problem. I am in a single event page and
    global $EM_Event seems to be null. The strange part is that this happens suddenly and it is true only for a specific event. Any hint?

Viewing 11 replies - 1 through 11 (of 11 total)
  • It happened to me too but I had a temporary fix:
    changing $EM_Event->post_id to get_the_ID()

    Thread Starter Rocco Marco Guglielmi

    (@roccomarco)

    I use $EM_Event->output to get custom parts of the event in other to create various theme parts.

    This is a serious bug.

    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?

    Thread Starter Rocco Marco Guglielmi

    (@roccomarco)

    Deactivated all the plugins, problem remain the same. Definitely not resolved.

    Thread Starter Rocco Marco Guglielmi

    (@roccomarco)

    I have currently created a function which I have to call in single-event.php to fix this bug. I suggest you to investigate the cause of this bug. I am pretty sure that it is not a theme or plugin conflict. I can help providing debug information.

    function ni_event_null_fix() {
      global $EM_Event;
      if($EM_Event == NULL) {
        $tmp = EM_Events::get(array('post_id' => get_the_id()));
        if(count($tmp) == 1)
          $EM_Event = $tmp[0];
      } 
    }

    Which version of Events Manager are you using?

    Thread Starter Rocco Marco Guglielmi

    (@roccomarco)

    The latest stable version. I update plugins everytime I can (unless they are buggy)

    Can you expand a bit more about the occasions when $EM_Event seems to be missing? Is it always the same event? Is is always a recurring event? Etc… Thanks.

    Thread Starter Rocco Marco Guglielmi

    (@roccomarco)

    It is always the same event, (not recurring). It has happened in two cases (for two different events), and I cannot find a logic in this: they seems to be completely uncorrelated.

    Tomorrow I will try to do some tests on the events affected by this bug (like changing some info, category, duplicating it and so on)

    Ok, great. It sounds like something specific to that event…

    Thread Starter Rocco Marco Guglielmi

    (@roccomarco)

    Thanks for your interest in this. BTW great plugin. I have created a lot of widgets on top of it creating a nice website.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Suddenly global $EM_Event is NULL into an event context’ is closed to new replies.