Support » Plugin: Events Manager » [Plugin: Events Manager] Bug: Locations not showing in secondary sites

  • Marcus,

    I found a small but very annoying bug, which occurs only in WP Multisite installations, when using EM from any blog except the main one.

    In the Add event page, when trying to recall a previously entered location, they just won’t show up, no matter if you’re using the autocomplete feature or the pulldown menu. I think the source of the problem is here:

    /events-manager/classes/em-locations.php, lines 210-217

    //blog id in events table
    if( is_multisite() && array_key_exists('blog',$args) && is_numeric($args['blog']) ){
       if( is_main_site($args['blog']) ){
          $conditions['blog'] = "('blog_id'={$args['blog']} OR blog_id IS NULL)";
          $conditions['blog'] = "('blog_id'={$args['blog']})";

    (they should be backticks enclosing blog_id, but since this forum won’t let me put backticks inside the code snippet I changed them to aphostrophes)

    Since locations table doesn’t have a blog_id field, the SQL condition added in the ELSE clause can’t ever be met.

    Hope it helps. Let me know if you need me to do some more testing.



  • The topic ‘[Plugin: Events Manager] Bug: Locations not showing in secondary sites’ is closed to new replies.