New Discourse post only created on update of WP post

When I first create a new post in Wordpress, it’s no longer auto-posting to Discourse. (Yes, the checkbox is selected.) It posts immediately if I click “update” on the post in Wordpress, though.

There’s no error when I first publish the post, but I also don’t see the notification banner saying that it was successfully published to Discourse at the top of the Wordpress editor page until I click update.

Any idea what could cause this, @simon?

Did this start happening after updating the plugin?

Well, I’m sorry to say that since this is still in staging, and I haven’t been using it much, I can’t say when it started. All I can say is that it was working correctly a month ago, and now it doesn’t. I’ve run updates when they pop up, but I have no idea what’s been updated. Is there any way of seeing a history of that in WP?

I’ve also probably installed other plugins since then. FWIW.

I can tell you that I’m running v1.6.5

This is probably being caused by a conflict with your theme or another plugin on your site. Can you share any details about your site’s theme and the plugins you have installed?

Thanks. That’s what I figured. I’m using Extra from Elegant Themes, and that’s been updated recently. Then I’m using a bunch of plugins, most of which are pretty standard. A few of them are more unique, though. I’ll run down the list and see if I can find the conflict.

3 Likes

Thanks! If you find out what is causing the problem, please let us know.

1 Like

I believe I’ve been able to narrow this down to a simple incompatibility with the Social Warfare plugin:

It’s a pretty popular plugin, and personally I’d really like to keep using it. I’m also fairly certain that the problem cropped up in a recent update, either to it or the Discourse plugin. Is there any chance of getting it fixed? Any other information I can provide? Logs I can look at?

Thx.

3 Likes

I’ve installed the Social Warfare plugin on my local development site. Unfortunately, I have not yet been able to replicate the problem that you are having. Looking at the plugin’s code, I can see something that might be causing a problem for you, so I’ll look at it some more and try to reproduce the error.

Perhaps a combination of settings? I’d be happy to provide screenshots of how I’m setup if you want.

That would be great. The plugin hooks into the WordPress save_post action in a few places. Depending on the order in which functions are being called, this could cause a conflict with the Discourse WordPress plugin.

Here you go. No SSO in use. First majority of WP Discourse settings and then Social Warfare ones. And let me know if you want anything from the actual Discourse instance. I’m assuming that is irrelevant. (Also other settings that I left out.)

1 Like

I still can’t reproduce this. If you can confirm that when the Social Warfare plugin is deactivate you can successfully publish posts to WordPress, I’ll install the plugin on a live site and test it out next week.

2 Likes

Just a quick update.

First, I disabled, deleted, reinstalled and reconfigured the WP-Discourse plugin. The problem persisted. Posts only made it to Discourse after hitting “Update,” not upon first publishing the post.

Second, I disabled all plugins, re-enabled only the WP-Discourse plugin, and confirmed that posting works properly right away on hitting “Publish.”

Third, I added just Social Warfare to the mix and the problem did not return. This is contrary to my previous results where I confirmed that the conflict was Social Warfare (using just the same method listed here, but without the first step). So I proceeded to further testing, re-enabling all the plugins a few at a time and testing each step of the way. The problem never returned.

Perhaps it has to do with the order that the plugins are enabled? Perhaps it was fixed by a recent update to one of the plugins? (But neither WP-Discourse nor Social Warfare have been recently updated.) So whatever the problem was, it seems to be gone. If it returns I’ll post back in here.

3 Likes