New post not creating new topics - used to work


(Kim McKenney) #1

Hi There,

Thanks so much for this plugin. I’ve been using it for about 6 months without any trouble, but my latest posts didn’t result in a new Discourse topic being automatically created upon publication. I checked everything in the editor against the last posts that did work and I can’t find any differences.

Up in the top right corner, where it says “Publish to Discourse”, the box is ticked for the appropriate category and the post published just fine otherwise, but no new topic…

Any suggestions?

Thank you!


(Simon Cossar) #2

Could you try publishing a post from WordPress and then looking at the error logs on Discourse (go to admin/logs and then click on ‘Error Logs’.) Is there any sign that the post is being posted to Discourse? Look for something like Started PUT "/posts/216" for ...


(Kim McKenney) #3

Hi Simon,

Thanks for the reply.

I did as you suggested and published a new post. This is what showed up in the error log:

My forum is linked to a member-only site. My developer has been using the Discourse SSO plugin to ensure only up to date members can view and comment on the forum. He developed a custom plugin to work in conjunction with it so refunded or expired members wouldn’t continue to have access. I know he was using user trust levels to make that happen. I think his plugin would check user status in the membership plugin, then coordination with Discourse.

We set the forum up so that members instantly had a user trust level that permitted them to view, comment and create new posts. I think, to make his plugin work, he “upped” the minimum user level and gave everyone that new level.

Anyway, obviously I don’t really know what I’m talking about, but it seems, from the error message that his plugin in likely the source of the problem. Do you think I should try manually changing my trust level or something like that, or do I just need to contact him?

Thanks for your help


(Simon Cossar) #4

Thanks! That’s helpful.

It might be causing the problem, but something similar to this came up recently with another user of the wp-discourse plugin. I wasn’t able to reproduce it myself, so it’s hard to know what’s going on.

Would it be possible to disable the custom plugin for a few minutes and see if you are still getting the same error when you try to publish a post to Discourse?


(Kim McKenney) #5

I would just click “deactivate”, right? No chance I could screw up his settings or work?

This is my first custom plugin, so I don’t know if they behave differently from the ones I grab from the WP plugin directory.

Sorry if this is a lame question.


(Simon Cossar) #6

Maybe you could try something else first. Deactivating a plugin will not delete its settings, but it’s possible that something else on your site is depending on that plugin being active, so it could have some unintended consequences.

Are you an admin user on both the WordPress site and the Discourse forum? If so, could you try doing this:

  • on Discourse, create a new API key for your user:

  • go to admin/users/your-username

  • look for the API Key setting on that page

  • click ‘Generate’

  • copy the generated API key into the WP Discourse ‘API Key’ input (found on the ‘Connection’ tab of the WP Discourse options.)

  • enter your Discourse username into the ‘Publishing Username’ field in the WP Discourse options.

  • click the ‘Save Options’ button at the bottom of that page

After doing this, are you able to publish a post? Let me know if any of this isn’t clear.


(Kim McKenney) #7

Hi Simon,

When I update the settings with the new API key I get an error message in WP-Discourse header saying I’m not connected to Discourse. When I revert back to the API key that was in there, the message disappears and I get “you are connected” message.

Was there something I was supposed to do on Discourse after generating the API? I looked for a save settings buttons there but couldn’t find anything.


(Simon Cossar) #8

No, it’s automatically saved.

When you entered the new API key in the WP Discourse plugin, did you also change the ‘Publishing Username’? It needs to match the username on Discourse that you generated the API key for.


(Kim McKenney) #9

That took care of the not connected message. I tried publishing a post again and it still didn’t generate a new topic.

Here’s the new error message:

Does that mean anything to you?


(Simon Cossar) #10

Thanks. It’s the same error as you were getting with the ‘All Users’ API key, so you should go back to using the ‘All Users’ API key.

I’ll try to find a way of reproducing the error.


(Kim McKenney) #11

so it is…

thanks :slight_smile:


(Simon Cossar) #12

Could you check your WordPress profile page (wp-admin/profile.php) and make sure that the username in the ‘Discourse Username’ field is correct?


(Kim McKenney) #13

Sure!

From WP profile
Discourse User Name: Kim McKenney

From Discourse Profile
Discourse User Name: KimMcKenney
Name: Kim McKenney

Always confusing for me with the spaces/no spaces options.

These settings are the same as they’ve always been, even when it was working.


(Simon Cossar) #14

What happens if you change the Discourse Username on your WordPress profile to KimMcKenney? (Make sure you click ‘update profile’ after making the change.)


(Kim McKenney) #15

Sorry for the delay. Got called away by a rare bit of sunshine.

That worked! Thanks for all your help and I hope you have a nice day!