Hello. I am recently getting an error from the WP-Discourse plugin that is preventing me from editing a blog post. I was recently upgraded to WP5 and also updated my DIVI theme. I suspect this has something to do with the error, but I’m not sure how to fix it.
My Discourse forum is hosted on Digital Ocean. I use the plugin so my users can share their same login from my WP site.
When I disable the plugin I do not get the error, but I cannot leave it disabled for obvious reasons. The error I get is (URL blocked out):
It happens for all posts. The post-type is just a blog post. I usually use the visual builder, but in this case I cannot even get that far. When I am in the list of posts in the dashboard, I click a post title to open it and that is when the error occurs.
I’m testing the plugin with the Divi theme now. So far I’m not getting the error you’re describing. What verson of the Divi theme are you using? I’m testing it with version 3.22.4.
Even if I can’t reproduce the error, it should be possible to fix it. The WP Discourse plugin shouldn’t be trying to access the index of a null value. The error message you have supplied should be enough to fix the issue. I’ll let you know when that’s been done.
I’ve found the bug. I’ll try to get the fix for it into the WordPress repo later today. Until then, if you could go to the WP Discourse Publishing settings tab and enable any of the post types you see in the ‘Post Types to Publish’ option, you should be able to edit your posts. Posts won’t be published to Discourse unless you click the ‘Publish’ button on the editor’s Discourse sidebar.
Thank you! That is awesome. I was about to start replying to your posts when I saw you fixed the bug.
I am not trying to publish anything to Discourse. These are just WordPress blog posts. I use the plugin only to help share the login with my WP site and my Discourse forum. I will try what you suggested, but I just wanted to clarify that I am not trying to post to Discourse.
By default there is always 1 post type enabled. I hadn’t tested the code for the case where no post types are enabled. For that case, the script that is causing you the trouble shouldn’t be loaded at all. This will be fixed in the next update - probably later today. I’ll let you know when that’s been done so that you can remove the post type you’ve had to add to the ‘Post Types to Publish’ setting.
Just to follow up, There were no post types selected before. I had someone else set this up for me for the purpose of SSO, but I had never looked at the option. It was not a problem before, perhaps it changed with the new WordPress. I can’t be certain. In any case, it’s great that it’s working now. I don’t think there is a downside to just leaving those checked since I won’t be publishing anything. At least not for now.