"Warning" appearing on ADD Form just above Time and Date section

Home Forums Calendar Products Community Events "Warning" appearing on ADD Form just above Time and Date section

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #45696
    hbgdio
    Participant

    Warning: Creating default object from empty value in C:\xampp\htdocs\wordpress\wp-content\plugins\the-events-calendar-community-events\lib\tribe-community-events.class.php on line 2103

    #45712
    Barry
    Member

    Hi hbgdio,

    Good catch: I’ll be sure to report that. In the interim I would recommend the first or both of the following:

    1. Although a warning correctly makes alarm bells ring in fact in this particular scenario PHP resolves the problem without any need for further intervention, so, certainly on your production or “live” site, all you really need to do is turn off the display of errors – which is a recommended practice in any case.

    2. You could put a temporary fix in place quite safely by adding a couple of lines of code within a template override, which I’ll detail below.

    Within your theme you would need an events directory, and that would need to contain a community sub-directory. You should then copy to that location the event-form.php template (you can find the original in plugins/the-events-calendar-community-events/views).

    Next, please locate the following line of code (around line 102) in your custom copy of :

    $this->formEventDetails( $event );

    Add some new lines just before it, as follows:

    global $post;
    if (is_null($post)) $post = new stdClass;

    Does that help at all?

    #45770
    punctilio
    Participant

    There is the same mistake. Fix the template, unfortunately, has not helped.

    Warning: Creating default object from empty value in [server]/wp-content/plugins/the-events-calendar-community-events/lib/tribe-community-events.class.php on line 2103

    #45771
    punctilio
    Participant

    I’m sorry, but the change has helped. I had forgotten to activate the theme right again.

    #45827
    hbgdio
    Participant

    Thank you for the quick response. The custom code did the trick. Thanks much.

    #45880
    Barry
    Member

    Excellent 😀

    #978943
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘"Warning" appearing on ADD Form just above Time and Date section’ is closed to new replies.