Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting an error on workpress post update of "Uncaught Error: Call to undefined function Distributor\InternalConnections\get_site()" #1218

Open
1 task done
dhanashreekere opened this issue Apr 22, 2024 · 2 comments
Labels
type:bug Something isn't working.

Comments

@dhanashreekere
Copy link

dhanashreekere commented Apr 22, 2024

Describe the bug

On updating few of the posts on Wordpress VIP website it throws an error of "Updating failed. The response is not a valid JSON response.".
image

By checking the network tab it is showing that issue is related to distributor plugin.
Error shown below:

To fix this issue I have added the code snippet in networkSiteConnection.php on line 749 by commenting line no. 748
`
//$site = get_site( (int) $blog_id );

if(function_exists('get_site'))
{
$sites= get_site( (int) $blog_id );
}
elseif(function_exists('wp_get_site'))
{
$sites= wp_get_site((int) $blog_id);
}
`

This code snippet has fixed the call which was failing before.

Steps to Reproduce

  1. Updated the post on wordpress. Changed SEO title in yoast plugin for the post and also content.
  2. On update showed error of "Updating failed. The response is not a valid JSON response."
    image
  3. On checking the post link, updated the content of post but not yoast plugins attributes (SEO title, meta description, keyphrases).

Screenshots, screen recording, code snippet

API Header:
image

Error on Wordpress dashboard Distributor --> pull content
image

Error response:
"Uncaught Error: Call to undefined function Distributor\InternalConnections\get_site()"

Environment information

No response

WordPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Tasks

No tasks being tracked yet.
@dhanashreekere dhanashreekere added the type:bug Something isn't working. label Apr 22, 2024
@kirtangajjar
Copy link
Member

@dkotter This issue seems to be caused by older version of WordPress(<4.6.0) that does not have get_sites() function. Since we only support WP 5.7+, I think this issue can be closed.

@dhanashreekere
Copy link
Author

Hello @kirtangajjar,
We were already on the wordpress's 6.3 version. Still we are facing this issue for few of our posts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

2 participants