• Getting this warning when trying to create an event:

    Warning: Creating default object from empty value in C:\xampp\htdocs\wordpress\wp-content\plugins\ajax-event-calendar\inc\admin-event.php on line 25

    Event may be getting created, but its not showing in the admin or the front-end.

    Has something to do with the event id from looking at the code.

    Help would be greatly appreciated.

    http://wordpress.org/extend/plugins/ajax-event-calendar/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter erea77

    (@erea77)

    This wouldn’t have anything to do with me running this on localhost would it?

    Thread Starter erea77

    (@erea77)

    You can delete the other posts.

    I they weren’t showing up so I didn’t think they were being created.

    Sorry

    so how did you fix the error? I have the exact same problem. The Calendar in my page isn’t showing the event…but the text widget of upcoming events is…

    This is probably because you’re running php > 5.3.1 and it doesn’t like using objects before creating them, I had the same issues, I fixed those by editing the following files of the plugin :

    ajax-event-calendar.php
    Line 1028, 1035 and 1039 add :
    $permissions = new stdClass();
    inc/admin-event.php
    Line 25 add :
    $event = new stdClass();

    Done !

    Thanks a lot!

    editing the following files of the plugin :

    ajax-event-calendar.php
    Line 1028, 1035 and 1039 add :
    $permissions = new stdClass();
    inc/admin-event.php
    Line 25 add :
    $event = new stdClass();

    That worked for me too!

    I am attempting to fix this same error — Can you please give the full text of the lines of code I am looking for? The lines are coming over double-spaced so I’m not sure if I am looking at the same lines that you are. (For example, there is nothing at line 1028 in my file)

    Would really appreciate a hand, thanks!
    -barbara-

    Thanks, Memphis007! Your solution worked for me also!

    @etellewyn:
    Find this function from ajax-event-calendar.php:

    function get_event_permissions($input, $user_id) {
        // users that are not logged-in see all events
        if ($user_id == -1) {
        $permissions->editable = false;
        $permissions->cssclass = '';
        } else {
            // users with aec_manage_events capability can edit all events
            // users with aec_add_events capability can edit events only they create
    	if ($input->user_id == $user_id || $user_id == false) {
    	    $permissions->editable = true;
    	    $permissions->cssclass = '';
    	} else {
    	    $permissions->editable = false;
    	    $permissions->cssclass = ' fc-event-disabled';
    	}
        }
        return $permissions;
    }

    and add these:

    function get_event_permissions($input, $user_id) {
        // users that are not logged-in see all events
        if ($user_id == -1) {
        $permissions = new stdClass(); //<--THIS
        $permissions->editable = false;
        $permissions->cssclass = '';
        } else {
            // users with aec_manage_events capability can edit all events
            // users with aec_add_events capability can edit events only they create
    	if ($input->user_id == $user_id || $user_id == false) {
    	    $permissions = new stdClass(); //<--THIS
                $permissions->editable = true;
    	    $permissions->cssclass = '';
    	} else {
                $permissions = new stdClass(); //<--THIS
    	    $permissions->editable = false;
    	    $permissions->cssclass = ' fc-event-disabled';
    	}
        }
        return $permissions;
    }

    And from the inc/admin-event.php:

    ...snip...
        global $current_user;
        // initialize form for new event
        get_currentuserinfo();	// wp data
        $event->id = '';
    ...snip...
    ...snip...
        global $current_user;
        // initialize form for new event
        get_currentuserinfo();	// wp data
        >$event = new stdClass(); //<--THIS
        $event->id = '';
    ...snip...

    @tannermirabel THANK YOU! This was exactly what I needed. Totally fixed the problem!

    Thanks a lot for taking the time to post this!

    most sincerely,
    -barbara-

    Thanks a Ton!

    This fixed my problem too…

    All the best

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Ajax Event Calendar] Getting a Warning in the create event form.’ is closed to new replies.