• Resolved goodereader

    (@goodereader)


    When publishing a new post, i get a fatal error. This only started happening on the new version that was pushed out today. On the wordpress email it states

    An error of type E_ERROR was caused in line 75 of the file /home/goodread/public_html/blog/wp-content/plugins/social-warfare/lib/utilities/SWP_Requests.php. Error message: Uncaught Error: Cannot use object of type WP_Error as array in /home/goodread/public_html/blog/wp-content/plugins/social-warfare/lib/utilities/SWP_Requests.php:75
    Stack trace:
    #0 /home/goodread/public_html/blog/wp-content/plugins/social-warfare/lib/utilities/SWP_CURL.php(38): SWP_Requests::file_get_contents_http(‘https://graph.f…’, NULL)
    #1 /home/goodread/public_html/blog/wp-content/plugins/social-warfare/lib/social-networks/SWP_Facebook.php(206): SWP_CURL::file_get_contents_curl(‘https://graph.f…’)
    #2 /home/goodread/public_html/blog/wp-content/plugins/social-warfare/lib/social-networks/SWP_Facebook.php(116): SWP_Facebook->get_og_id(‘https://goodere…’)
    #3 /home/goodread/public_html/blog/wp-content/plugins/social-warfare/lib/utilities/SWP_Post_Cache.php(641): SWP_Facebook->get_api_link(‘https://goodere…’)
    #4 /home/goodread/public_html/blog/wp-content/plugins/social-warfare/lib/utilities/SWP_Post_Cache.php(525): SWP_Post_Cache->establish_api_request_urls()
    #5 /home/goodread/public_html/blog/wp-content/p

Viewing 6 replies - 16 through 21 (of 21 total)
  • Joe

    (@joewa1980)

    @govnoblat – it’s a fix from the Social Warfare support team, my tests have proven successful.

    thanks!

    Mat

    (@mateustav)

    This issue is being caused by the fact that this the app is trying to merge an undefined variable with another array. $response is only scoped inside a foreach loop in line 62, it’s never declared outside of it so it’s never actually available during the merge so the variable must first be declared outside the loop and that should fix the issue.

    This is how I fixed the issue:

    Go to wp-content/plugins/social-warfare/lib/utilities/SWP_Requests.php and replace lines 59-62 to include the variable declaration (or you can wait for the team to push the fix). ??

    Before:

    // Loop through and parse the response
    foreach( $responses as $key => $object ) {
      $response[$key] = $object->body;
    }

    After:

    // Loop through and parse the response
    $response = array();
    foreach( $responses as $key => $object ) {
      $response[$key] = $object->body;
    }
    Joe

    (@joewa1980)

    Thanks @mateustav – the fix was pushed out as a pre-release beta from the support team as a download, see above. It will then be implemented in the next release.

    When is the new release coming out? I don’t want to have to pay/hire someone to bandaid this in the meantime? Thinking of just ditching this plugin which is frustrating since it may mean I lost many, many years of social share numbers.

    Plugin Author WarfarePlugins

    (@warfareplugins)

    We are sorry to hear that you are experiencing this issue.
    It has been resolved. The patch is exactly as @joewa1980 describes above in the thread.
    We are releasing v4.4.1 later today that includes that patch, and fixes some other bugs that have been reported.

    Thanks for your feedback and patience as we are working to expand our support team to manage the increasing number of users on our platform.

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Fatal Error with new version’ is closed to new replies.