When you link a post to a Discourse topic, it does not update the topic until you select the ‘Update Discourse topic’ checkbox. Linked posts do not add the blog URL to the Discourse topic.
Can you try this with another post and see if you get the same error?
Thanks for trying that! Can you give any details about the post that is returning the 422 error? Does the topic that it is linked to exist on your forum?
We are finding this problem right now, and I think I can contribute to this discussion. What happened in our case is:
An article is published in WordPress and a related topic is automatically created in Discourse.
However, for whatever reason (user post limit?), the new topic goes automatically to moderation.
The moderated topic is not public, The WP-Discourse plugin cannot “see it” and throws a first error message: Reason for failure: A bad response was returned from Discourse. Check that: - your Discourse forum is online.
If the moderator approves the post because everything is correct there, then…
When updating the article in WordPress in order to have a Discourse topic linked, the WP-Discourse plugin finds an article with an identical title / content, and this is what cause a second error message:
Reason for failure:
A 422 response code was returned from Discourse.
Unprocessable Entity
The solution is to delete the first Discourse topic and update the page again.
Thanks for mentioning this. If a post that is published to Discourse gets added to the Needs Approval queue, the WordPress plugin should give some feedback about how to deal with it.
After the post has been approved you can also select the ‘Link to Existing Topic’ option from the post’s Discourse metabox. In the Topic URL field, enter the URL of the approved Discourse topic.
Yeah, I wonder why occasionally a post of these goes to moderation. It is sent by a trusted user. Maybe there is some kind of throttle? Several posts might be queued in WordPress, and then an administrator reviews them and might approve several of them pretty quickly.
Not in our case because we have the “Force publish” option enabled. Therefore the metabox only says.
The force-publish option has been enabled. All WordPress posts will be published to Discourse in the Kaosenlared category.
Once you know what is going on, it is not a big deal.
When posts that are published from WordPress to Discourse get added to the Discourse approval queue, the user publishing the post should now see this message:
When the topic is approved on Discourse and the Topic URL is updated on WordPress, they will see this:
Let me know if you are finding any posts that are added to the approval queue on Discourse but are not displaying this message on WordPress.
Are you able to publish any posts when the glossary plugin is enabled? What is the name of the plugin? Are you using the WordPress Block Editor, or the old Classic Editor?
How large is the glossary you were adding? I just tried the plugin with two items in the glossary and adding the shortcode to a post didn’t cause a problem.
Could you try temporarily unchecking the ‘Use Full Post Content’ setting on WordPress and then updating the post again? If you don’t get any errors when you try that, then we’ll know that the problem is related to the content of the post. If you do get errors, then the problem will be related to the post’s metadata.