Problems linking post to existing topic

AI-generated summary

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?

Thanks.

From the error message you have given, it sounds like you are using the WordPress Classic editor. Is this correct? If so, I’ll test it out.

Yes. The classic editor. Thx.

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.

Any other ideas?

I have seen problems with linking topics in the past when multiple domains are pointing at the Discourse site. Is your forum self-hosted?

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.

Ah. I remember now that we asked for the house ads plugin on Discourse which caused them to move us to a new server.

Perhaps I should simply re-setup the WP plugin and see if that fixes it?

There should be no other differences than that plugin though. So I doubt this has anything to do with this issue.

Completely deleting the Discourse plugin in Wordpress and reinstalling it and setting it up with exactly the same settings fixed the issue.