WordPress.org

Ready to get started?Download WordPress

Forums

Fetch Tweets
[resolved] Fatal error: Unsupported operand type.. (13 posts)

  1. Rahul
    Member
    Posted 9 months ago #

    Hi,

    I get this error wherever I put the shortcode (in widgets) or view fetched tweets in separate page..

    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/r/a/rapidc/www/tst/wp-content/plugins/fetch-tweets/class/FetchTweets_Fetch_.php on line 290
    No result could be fetched.

    I am not sure why is it causing.. Previously I had issues with cache. It was not updating tweets at all in any rule. But after I deactivated and activated plugin again. I am getting this error.. I tried resetting settings but no luck..

    My Consumer Key, Token and everything is correct.. I checked it multiple times. No issues with the same..

    http://wordpress.org/plugins/fetch-tweets/

  2. miunosoft
    Member
    Plugin Author

    Posted 9 months ago #

    Hi,

    Sounds like the cache data is broken. I barely imagined it would occur but you got that. So I rewrote some code that deals with caches.

    Please try the development version and let me know if it works or not.

  3. Rahul
    Member
    Posted 9 months ago #

    Hi,

    Thank you for such a prompt reply.

    I tried installing development version. Cleared Settings as well as Cache..

    Now I am getting this error..

    Fatal error: Cannot use string offset as an array in /home/r/a/rapidc/www/tst/wp-content/plugins/fetch-tweets/class/FetchTweets_Fetch_.php on line 569

  4. miunosoft
    Member
    Plugin Author

    Posted 9 months ago #

    That line is reached when the Twitter API returns an error. I intentionally sent a request to make the Twitter API return an error but I don't get that PHP error message.

    Are you modifying the plugin's code?

  5. Rahul
    Member
    Posted 9 months ago #

    ^ Nope, I am not.. Plugin is intact.. I don't know what's wrong :-(

    My consumer key and tokens are correct, I rechecked.

  6. miunosoft
    Member
    Plugin Author

    Posted 9 months ago #

    Just before the line that causing the PHP error, there is a conditional statement that checks whether the subject variable is an array and has necessary keys. So I suppose it's impossible to get that message unless the code is modified.

    I added an additional condition to that line to check the type and updated the development version. Please try it.

  7. Rahul
    Member
    Posted 9 months ago #

    I am not editing the plugin. I tried the new development version. It returned me the same error..

    Fatal error: Cannot use string offset as an array in /home/r/a/rapidc/www/tst/wp-content/plugins/fetch-tweets/class/FetchTweets_Fetch_.php on line 573

  8. miunosoft
    Member
    Plugin Author

    Posted 9 months ago #

    Isn't it line 574?

    Can you post the entire output including the error table elements? It may have a table row indicating Variables in local scope (#1) etc. The snapshot would be helpful.

  9. Rahul
    Member
    Posted 9 months ago #

    Nope.. I get only this error..

    Fatal error: Cannot use string offset as an array in /home/r/a/rapidc/www/tst/wp-content/plugins/fetch-tweets/class/FetchTweets_Fetch_.php on line 573

    Nothing else..

    Screenshot here : http://i.imgur.com/Hwdopdr.png

  10. miunosoft
    Member
    Plugin Author

    Posted 9 months ago #

    Okay, that indicates you got the result as non-array.

    What I can think of now is that it could be due to some other plugins or themes are using the same Twitter library with the same name.

    I renamed the library name and updated the development version. Please try it again and let me know what happens then.

    [Edit] When I posted this, some files were not updated. They were fixed by now.

  11. Rahul
    Member
    Posted 9 months ago #

    New error pops now

    Fatal error: Unsupported operand types in /home/r/a/rapidc/www/tst/wp-content/plugins/fetch-tweets/class/FetchTweets_Fetch_.php on line 344

    Don't know what's wrong! :-(

  12. Rahul
    Member
    Posted 9 months ago #

    Fixed it.. Some other plugin was conflicting names i believe

  13. miunosoft
    Member
    Plugin Author

    Posted 9 months ago #

    Glad that it was fixed.

    Which plugin was it by the way? I maybe able to make it fixed even when the other plugin is activated.

Reply

You must log in to post.

About this Plugin

About this Topic