WordPress.org

Ready to get started?Download WordPress

Forums

All-in-One Event Calendar
[resolved] Fatal error: Cannot use object of type stdClass (21 posts)

  1. brimstoneloa
    Member
    Posted 4 months ago #

    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/

  2. billrodgers2013
    Member
    Posted 4 months ago #

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

  3. brimstoneloa
    Member
    Posted 4 months ago #

    You sir, rock.

    Applied fix, worked. THANK YOU!

  4. prinehart
    Member
    Posted 4 months ago #

    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.

  5. Jashan
    Member
    Plugin Author

    Posted 4 months ago #

    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

  6. grndrm
    Member
    Posted 4 months ago #

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

  7. Jashan
    Member
    Plugin Author

    Posted 4 months ago #

    Hello,

    I am glad it worked for you :D

    Take Care

  8. sheritptah
    Member
    Posted 4 months ago #

    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

  9. billrodgers2013
    Member
    Posted 4 months ago #

    ^^^ Yes. Comment out line 160.

  10. DanMcLeanJr1
    Member
    Posted 3 months ago #

    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!

  11. barnabasnagy
    Member
    Posted 3 months ago #

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

  12. Jashan
    Member
    Plugin Author

    Posted 3 months ago #

    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

  13. barnabasnagy
    Member
    Posted 3 months ago #

    Thanks @Jashan sounds good.

  14. Jashan
    Member
    Plugin Author

    Posted 3 months ago #

    Hello @brimstoneloa,

    Please mark this as resolved :)

    Cheers!

  15. b1rian
    Member
    Posted 3 months ago #

    Amen for me.

    Solved via removed line #128 as per post Jashon.

    Cheers mate.

  16. billrodgers2013
    Member
    Posted 3 months ago #

    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

  17. friedVol
    Member
    Posted 3 months ago #

    Ok, so I researched the phrase "comment out" and found it means to add 2 forward slashes to the start of a line - as in // (line 160 text here)

    And if there are multiple lines in the comment, then to bracket the lines with /* */ as in /* (line 160 text here) */

    But what I can't tell is how to know which line is Line 160. They're not numbered.

    Do space lines between sections of text count as a line in this case?

    Does { count as a line if it's by itself? Or is it considered part of the instruction that comes after?

    What about multiple-lined comments bracketed with /* ---*/? Does the whole comment count as one line?

    What would help is if someone would post the text of Line 160 (and Line 128 for that person) here, so we'd know what to look for.

    Thanks.

    (and yes, this belongs here and not in a separate post. Why should someone have to hunt in the forums for half an hour or so for a post that explains what this post's solution "Comment out Line 160" means?)

  18. friedVol
    Member
    Posted 3 months ago #

    Ok, my face is red.

    I put the cursor at the start of line one in the all-in-one-event-calendar.php file that I opened in Notepad and began scrolling down.

    The line number shows at the bottom right of the file window, along with the Col number.

  19. billrodgers2013
    Member
    Posted 3 months ago #

    ^^ Notepad++ is good for this. Download it. You might need it again.

  20. toddlack
    Member
    Posted 3 months ago #

    Thank you! I had the same issue, commenting out line 160 did the trick.

  21. imusmi
    Member
    Posted 2 months ago #

    Nice work Jashan.....Its working
    GOD BLESS YOU MAN

Reply

You must log in to post.

About this Plugin

About this Topic