jtbayly is experiencing an issue with the Wordpress plugin for Discourse, receiving an error when attempting to link a post to an existing topic. simon suspects it may be due to using the WordPress Classic editor and investigates further.
They discuss possible causes, including domain mismatches and multiple domains pointing to the Discourse site. jtbayly confirms the domain is correct and suspects an issue with the plugin or Discourse upgrade. simon suggests checking for recent changes to the WordPress site.
jtbayly recalls a recent server move and considers re-setting up the plugin. michaeld doubts the server move is the cause. However, jtbayly finds that completely deleting and reinstalling the plugin, with the same settings, resolves the issue.
Several times with the Wordpress plugin I’ve removed a link to one topic, saved the post, and then attempted to add a link to different existing topic, only to get this error:
There has been an error linking this post with Discourse. Make sure you are supplying the URL of an existing topic on your forum.
Any ideas how I can fix this? Or is it a bug others can reproduce?
You will get the error you are reporting if the domain of the topic you are attempting to link to doesn’t match the domain of the Discourse URL you have entered on the plugin’s Connection Settings tab. Does this sound correct for your case?
No. It’s the same domain that it auto-posts to. Just a different topic. Just checked the domain and it is correct. I doubt auto-posting would work if that setting was wrong.
No. We are on Communiteq (formerly DiscourseHosting).
Oddly I know this used to work. I don’t know when it stopped working, but the change must have been upgrading either Discourse itself or the Wordpress plugin. I’m pretty sure nothing else in settings changed.
I don’t think anything has changed in the plugin’s code for linking topics recently. Have there been any recent changes to your WordPress site? For example, have you moved it to new hosting, or changed the version of PHP that it’s using?
The domain name is parsed from the URL with wp_parse_url. It is possible that it’s not parsing the domain correctly.