WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] [closed] Warning: Creating default object from empty value... (32 posts)

  1. cfatiuk
    Member
    Posted 2 years ago #

    Hello,

    Love your plugin but I am having an issue that I cannot seem to resolve. I have set up events categories. The main events category works fine and displays events from all categories however when I click on an event category link I get this error message at the top of the page:

    Warning: Creating default object from empty value in /homepages/7/d446195118/htdocs/wp-content/plugins/events-manager/classes/em-category-taxonomy.php on line 22

    The page content eventually loads but it isn't formatted like the main event category and the error message remains at the top.

    Any help you can give me to get this functioning propoerly is greatly appreciated. Thank you in advance.

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

    hi,

    just to narrow down the problem have you try to temporarily;

    - disabling other plugins to see if one this causes a conflict
    - switching to default theme (twenty twelve) to ruled out any theme specific problems

  3. cfatiuk
    Member
    Posted 2 years ago #

    Sorry, I should have mentioned that - yes I tried disabling othe plugin and switching to default theme but it doesn't change anything.

    The URL is http://s446195138.onlinehome.us/

    the 2 categories are events tab and the sub-menus class schedule and vacations & day trips.

  4. Jollumi
    Member
    Posted 2 years ago #

    Hi there,

    I've got the same issue with Events Manager. I avoided the problem by switching back to a previous realease of EM.

    The file em-category-taxonomy.php has changed since the version 5.3.3
    As I'm not able to figure out what causes this error message, I tried the version 5.3.2 and everything went back to normal. That's a first step.

    Does anyone have a clue of a way to fix this properly?

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    have you tried the latest update (5.3.5)? I think that'll fix this problem.

    I'm guessing in both your cases you don't have a category page defined, if so then the latest update accounts for that.

  6. Jollumi
    Member
    Posted 2 years ago #

    In my case, I was using the latest update on my local website (under development) and I've got the same problem. And yet, I do have a category page defined under mysite.com/events/categories.

    I don't know why and how but I just moved my site to live server and I don't get this error message anymore.
    Thanks for your help Marcus.

  7. cfatiuk
    Member
    Posted 2 years ago #

    Hi Marcus,

    Thanks for your reply. I am using 5.3.5 on WP 3.5. Still having this issue. I went back and created a new category which I made the default category under General Options > Default Category under settings and that page too gives an error message.

    Is that what you meant by defining a category page? Any advice?

  8. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    no, by that I mean a categories (typo in last comment) page, i.e. defined in Events > Settings > Pages > Categories

    without it, and with our formatting enabled we're tricking WP into thinking this is a page but in the recent WP update something changed so that it complains with the above message.

    Will look into this further, however defining a default categories page does fix this problem.

  9. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    btw, this will also apply to tags pages, although in this case there's no page to assign as a 'tags' page.

  10. cfatiuk
    Member
    Posted 2 years ago #

    Thanks for the clarification but still not having any luck. I did revert back to 5.3.2 and the issue is resolved however I see there were some important updates since then.

    It works for the all the category pages now except that my category pages use the first event title in the category list as the page title even though I have set it to #_CATEGORYNAME.

    Marcus do you have any advice to get these issues resolved? Many thanks in advance!

  11. cfatiuk
    Member
    Posted 2 years ago #

    For instance this page's title should be "Classes" not "Orality in James Joyce Conference"

  12. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    did you try my suggestion r.e. create a categories page?

    no, by that I mean a categories (typo in last comment) page, i.e. defined in Events > Settings > Pages > Categories

    currently that's the only way to get this working without that warning (unless you disable our formatting option for category pages), looking into ways around that.

  13. cfatiuk
    Member
    Posted 2 years ago #

    Yes, I created a new page and defined it as category page but no luck. Thanks for your help.

  14. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    there's two issues here... one is the php warning and the other is a title problem. does adding a categories page fix the php warning (it should do)?

    regarding titles, someone else had a similar issue, and we never figured out why, but they removed that particular event from the category that was replacing the title and it seemed to have fixed the problem.

    when they recreated (not duplicated) the same event with the same details and re-added it to the category the problem seemed to go away. maybe worth a try?

  15. cfatiuk
    Member
    Posted 2 years ago #

    Adding a category page does not resolve the issue in my case : (

    I tried delating all the events and adding new but that didn't change the category from showing either.

  16. cfatiuk
    Member
    Posted 2 years ago #

    The main events page displays just fine with the title in v 5.3.2 but it is the other categories that don't display the category title.

    http://s446195138.onlinehome.us/events/

    http://s446195138.onlinehome.us/events/categories/classes-2/

  17. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    @cfatiuk, have you tried this on the default WP theme to see if it works there?

  18. scharc
    Member
    Posted 1 year ago #

    I have exactly the same problem, even when i switch back to twentytwelve i get the php warning.

    i found out two things while figuring what was going wrong. first, i created a taxonomy-event-categories.php to do som special formating, still either php warning and some formating or no warning but then not formating :(

    i followed all advice here, plugins off, switch them, make a lot of extra pages, used all templates in every possible order, still no luck.

    i even went to the function in em-category-taxonomy -> function template($template)

    and tried die(var_dump($template));

    when i get the php warning $template is an empty string, when i get no warning, the template() function never runs

    i could give more debug if somebody tells my what to do...

  19. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    where exactly do you do die(... ?

    I can't reproduce this error

  20. scharc
    Member
    Posted 1 year ago #

    function template($template){
    		die(var_dump($template));
    		global $wp_query, $EM_Category, $em_category_id;

    right there ...

    give me some hints what you need to debug and i will do

  21. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    I'm not sure where to start.... in that case WP is already not giving us a template, meaning there's something outside this function probably causing the problem. we don't even have the chance to mess with templates or wp_query at that point.

    what page exactly do you see this error? a single category page?

  22. scharc
    Member
    Posted 1 year ago #

    i created a file called 'taxonomy-event-categories.php' in my theme root same as 'single-event.php' for some theming reasons (i used to use simple-fields plugin to do some theming)

    when my theme is rnning the taxonomy-event-categories.php, i dont get the object error but strangly, em-theming is not working... it just drops an unstyle eventlist:

    Freitag, 8. März 2013 - Sonntag, 10. März 2013
    16:00 - 18:00 Orality in James Joyce Conference
    Arts Millenium Building, Galway Galway Freitag, 29. März 2013
    20:00 - 22:00 Traditional music session
    The Crane Bar, Galway Galway Samstag, 1. März 2014
    22:00 - 23:00 6 Nations, Italy VS Ireland
    Taaffes Bar, Galway Galway

    when i rename the file, i get this error (with wp debug enabled):

    Warning: Creating default object from empty value in /wordpress/wp-content/plugins/events-manager/classes/em-category-taxonomy.php on line 22
    Notice: Undefined property: stdClass::$ID in /wordpress/wp-includes/query.php on line 3385

    but the em-theming is working at that point, but doing something strange in the loop. when i enabled the custom fields via simple-fields it was replacing all my content (even the custom vars) with the em-loop

    i dont need the category page, so my dirty workaround is avoiding the category links everywhere...

  23. agelonwl
    Member
    Posted 1 year ago #

    Hi @scharc,

    could it be a plugin conflict cause by simple-fields plugin? and if you rename your custom taxonomy template this plugin search for it? it is possible to temporarily disable this plugin just to narrow down the problem?

  24. scharc
    Member
    Posted 1 year ago #

    @agelonwl the only plugin running right now is em.

    i still get the
    Warning: Creating default object from empty value in /wordpress/wp-content/plugins/events-manager/classes/em-category-taxonomy.php on line 22

    when there is no file called: taxonomy-event-categories.php

    when there is a file called taxonomy-event-categories.php the warning is gone but no em-themed event list

    i could come to any irc channel to talk more about that problem, if neccessary

  25. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    i think taxonomy-event-categories.php overrides our themeing structure, so you'd need to run something like

    EM_Category_Taxonomy::content();

    on that custom template instead of using normal WP methods.

    if you have a screenshot of your categories settings in the 'Pages' tab that may help

  26. scharc
    Member
    Posted 1 year ago #

    here you go:

    http://imgur.com/YQSBc0F

    german, i hope you dont mind

  27. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    odd, but I don't get this problem, using the same settings.

    did you try my suggestion above?

  28. scharc
    Member
    Posted 1 year ago #

    nope because i am not sure how to use it in my custom-tax-**.php

    anyways, i will not use categories in my site and activly prefent users to get there (header()-redirect )

  29. Philosurfa
    Member
    Posted 1 year ago #

    Hi -

    Am wondering if any further progress has been made in resolving this issue?

    I too am experiencing difficulties in listing events within a specific category without the following error message being displayed -

    Warning: Creating default object from empty value in /homepages/46/d460955225/htdocs/International_Legal_English/wp-content/plugins/events-manager/classes/em-category-taxonomy.php on line 22

    Am presently in the process of fleshing my site out with content, during the course of which I intend to upgrade to the PRO version of the software, and it would be great if I was able to list events by category, as the plugin is otherwise absolutely ideal for my purposes.

    P.S. Would be more than happy to make the contents of my site (as they presently stand) available for inspection/experimentation, if this might help to get to the bottom of the problem.

  30. LazyLeopard
    Member
    Posted 1 year ago #

    Rather oddly, I have this problem in one of three copies of a site I'm testing. They're on different servers, so I'm busy trying to determine whether there are any server settings that might cause one to throw the warning while the other two do not. (Edit: Yes, the server showing the message is set to display errors, and the others were not. The warning is displayed on all three now that I've alogned their settings more closely.)

    I do have a plugin active that adds custom attributes to posts, including custom post types like events and locations, and initially I wondered whether the non-EM custom attributes were giving EM a problem...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic