WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Fatal error: Cannot use object of type stdClass

[Resolved] Fatal error: Cannot use object of type stdClass

  • brimstoneloa
    Member

    @brimstoneloa

    Things were humming along amazingly well… and then THIS error popped up. I’m devastated. Hoping someone can help me out.

    When I try to visit my PLUGIN page, I get this message:

    Warning: array_search() [function.array-search]: Wrong datatype for second argument in /home/jarhead/public_html/wp-content/plugins/all-in-one-event-calendar/all-in-one-event-calendar.php on line 160

    Fatal error: Cannot use object of type stdClass as array in /home/jarhead/public_html/wp-content/plugins/all-in-one-event-calendar/all-in-one-event-calendar.php on line 160

    Any ideas?

    Thank you so very much in advance!

    https://wordpress.org/plugins/all-in-one-event-calendar/

Viewing 15 replies - 1 through 15 (of 22 total)
  • billrodgers2013
    Member

    @billrodgers2013

    Comment out line 160. Doesn’t affect anything else and is the recommended fix.

    brimstoneloa
    Member

    @brimstoneloa

    You sir, rock.

    Applied fix, worked. THANK YOU!

    prinehart
    Member

    @prinehart

    I’m getting the same error, but it says error on 128. When I go to look at the code, all I see a remark.

    Hello,

    To fix this, please FTP your site, and go to Wp-content -> plugins -> All in one calendar -> all-in-one-calendar.php and delete the following code at line 128
    unset( $plugins->active[ array_search( $basename, $plugins->active ) ] );

    This should fix the issue.
    Thanks

    grndrm
    Participant

    @grndrm

    Thank for the posted solutions to this issue. Very helpful!

    Hello,

    I am glad it worked for you 😀

    Take Care

    sheritptah
    Member

    @sheritptah

    should I do the same if my message is the following

    Warning: array_search() expects parameter 2 to be array, object given in /home/adminii/generationsonthemove.org/wp-content/plugins/all-in-one-event-calendar/all-in-one-event-calendar.php on line 160

    Fatal error: Cannot use object of type stdClass as array in /home/adminii/generationsonthemove.org/wp-content/plugins/all-in-one-event-calendar/all-in-one-event-calendar.php on line 160

    billrodgers2013
    Member

    @billrodgers2013

    ^^^ Yes. Comment out line 160.

    DanMcLeanJr1
    Participant

    @danmcleanjr1

    I seem to be having the same problem at line 160, Bill. My php at line 60 is empty. Nothing there. What do I need to enter in order to “comment out” that line. I haven’t been able to find the answer by Googling.
    Thanks in advance!

    barnabasnagy
    Member

    @barnabasnagy

    Commenting out works indeed. I just wonder why does time.ly does not fix the code? @jashan?

    Hello @barnabasnagy,

    We have already fixed it for the next release. We are hoping to release 2.0 soon, and this issue is fixed in that version.

    Thanks

    barnabasnagy
    Member

    @barnabasnagy

    Thanks @jashan sounds good.

    Hello @brimstoneloa,

    Please mark this as resolved 🙂

    Cheers!

    Amen for me.

    Solved via removed line #128 as per post Jashon.

    Cheers mate.

    billrodgers2013
    Member

    @billrodgers2013

    Just to clarify this.
    It’s line 160 in Std and line 128 in Pro.
    File in question is all-in-one-event-calendar.php

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘[Resolved] Fatal error: Cannot use object of type stdClass’ is closed to new replies.