distributor
distributor copied to clipboard
Getting an error on workpress post update of "Uncaught Error: Call to undefined function Distributor\InternalConnections\get_site()"
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.".
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
- Updated the post on wordpress. Changed SEO title in yoast plugin for the post and also content.
- On update showed error of "Updating failed. The response is not a valid JSON response."
- 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:
Error on Wordpress dashboard Distributor --> pull content
Error response: "Uncaught Error: Call to undefined function Distributor\InternalConnections\get_site()"
Environment information
No response
WordPress information
No response
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
### Tasks
@dkotter This issue seems to be caused by older version of WordPress(<4.6.0) that does not have get_site()
function. Since we only support WP 5.7+
, I think this issue can be closed.
Hello @kirtangajjar, We were already on the wordpress's 6.3 version. Still we are facing this issue for few of our posts.
@dhanashreekere Would it be possible to share the full stack trace of the error? I'm assuming both the sites are on an internal network?
@qasumitbagthariya I tried to reproduce this error, but I was unable to. Can you try to reproduce it on your end? Do the following:
- On a MU site, create a post and then distribute it to the other site.
- Update post title, post content and yoast title and excerpt.
- Check if you can get the "Updating Failed" error as reported in the issue.
@kirtangajjar I tried to reproduce but could not replicate the "Updating Failed" error.