Support » Plugin: Events Manager » Categories in multisite (bug in widgets on subsites)

  • Resolved Fee


    Hi Marcus,

    there’s an issue with the categories in multisite: On subsites the content after the event widgets break and/or urls break after them.
    This code breaks:
    In classes/em_event.php, inside of output() line 1643-1650 the categories are called:

    //for backwards compat and easy use, take over the individual category placeholders with the frirst cat in th elist.
    $EM_Categories = $this->get_categories();
    if( count($EM_Categories->categories) > 0 ){
    	$EM_Category = $EM_Categories->get_first();
    if( empty($EM_Category) ) $EM_Category = new EM_Category();
    $event_string = $EM_Category->output($event_string, $target);

    Please tell me if I’m wrong but I think categories are only on the mainsite, that’s the way it works in my install. So if I put these lines inside of the condition
    the issue is solved and everything works fine 🙂

    On a events details page it’s breaking again. Therefore lines 1554-1558 has to be commented out, too:

    	$template = em_locate_template('placeholders/categories.php', true, array('EM_Event'=>$this));
    	$replace = ob_get_clean();

    Inside of placeholders/categories.php the $EM_Event is empty.

    But I think that’s not the way it is meant to be… The categories should be listet on subsites, too.

Viewing 14 replies - 1 through 14 (of 14 total)
  • thanks, no doesn’t help. I want to use global tables and I want the categories to be edited by super admin. It’s not a problem of not knowing how to configure my settings, it’s a bug inside of the code that breaks my page…

    The problem is:
    1. On single event page (in frontend) on a subsite the site breaks during the mentioned category specific code.
    2. On all pages on a subsite (in frontend) the site breaks during event widget and calendar widget.

    This looks like that:
    A. All following widgets are not displayed.
    B. All following intern URLs change from subsite URL to mainsite URL.

    Plugin Author Marcus


    I’ve tested this and am not getting this problem.

    Even though categories are held on the main site when in global mode, you should still be able to assign/display categories on sub-sites.

    are you on the latest version of EM? we’ve made some MS improvements there.

    Hi Marcus, thanks for your reply!
    Yes, I’m on the last EM…
    The categories do display, but after them the page breaks. It’s like they are fetched from mainsite and then the code continues with blog_id or something related from mainsite instead of going on with the data from subsite. It’s hard to explain, and unfortunately I’m on a local site, so you can’t take a look at it.

    Plugin Author Marcus


    Can you check your php error logs? There must be a fatal error that may give us a clue.

    I’m sorry, there are no errors in it 🙁
    (errors of other plugins, yes, but of course I deactivated all other plugins for this test and now there is no error)

    Just upgraded to WP 3.5 RC2, problem persists.

    Hi Marcus,

    I opened my online demopage now that you can take a look at it (both for this thread and

    I’m sorry that I can’t deactivate all plugins there because some plugins need to be network activated for the other subsites in this multisite setup. But on my local server the bug is exactly the same, even with all plugins truned off (except EM).

    I prepared a querystring for testing:
    if you add “?showcat=1” to the url it shows you the bug (then both code snippets from reply#1 are active).
    Look at the widgets, most of them disappear.
    In the footer (without the querystring) you can read the name and link of the page, with the querystring on it turns to the name and link of the mainsite, and “Kontakt” (is part of a footer menu here) disappears.

    Plugin Author Marcus


    can you give me a link to page where this breaks? adding ?showcat=1 to the url above works ok.

    btw, showcat=1 isn’t something EM does, so I’m thinking maybe it’s e.g. your theme or a custom script you wrote.

    Maybe I wasn’t clear, sorry for my English.
    The page is – does it really work at you with the query string?
    I added this string myself. In post#1 I wrote that I have to comment out the code snippets. So I did this for testing now: Not commenting out but adding a if(isset($_GET[‘showcat’]) && $_GET[‘showcat’] == ‘1’){…} around it inside your classes/em-event.php.

    Plugin Author Marcus


    shows a full page for me, nothing breaks.

    just checked different browsers on win and mac now to make sure it’s no browser issue. It’s the same in all browsers, so it must be visible for you, too.

    It’s not the whole page that breaks.
    Please take a look at the widgets in the sidebar, and in the footer line. Look at it without the querystring and then with the querystring.
    Most of the widgets disappear and the site link changes as I wrote above.

    To be clear again: I added the querystring myself and hardcoded it in your plugin – only for now that YOU can test it.

    Plugin Author Marcus


    ok i see the difference, however this is probably something you’ve coded in somewhere because it’s just showing different widgets but the page finishes loading so there’s no errors.

    pretty sure EM would have nothing to do with which widgets are loaded on a sidebar.

    Hm, this is marked as resolved, but not really resolved yet – if anybody looks here: the problem is related to and we discussed it there

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Categories in multisite (bug in widgets on subsites)’ is closed to new replies.