I’m getting an error message when I try to create a new post or page…
TypeError: Cannot read property ‘split’ of undefined
at DiscourseSidebar.buildPostState (https://fpadvance.com/wp-content/plugins/wp-discourse/admin/discourse-sidebar/build/index.js?ver=1606956042:1211:41)
at DiscourseSidebar.initializePostState (https://fpadvance.com/wp-content/plugins/wp-discourse/admin/discourse-sidebar/build/index.js?ver=1606956042:1192:43)
at new DiscourseSidebar (https://fpadvance.com/wp-content/plugins/wp-discourse/admin/discourse-sidebar/build/index.js?ver=1606956042:1124:29)
at Ag (https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:63:107)
at Vg (https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:89:442)
at ph (https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:217:70)
at lh (https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:126:409)
at O (https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:121:71)
at ze (https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:118:14)
Thanks, this one will be resolved when this is merged
Thanks Angus! Your changes have been merged into WP Discourse 2.2.0. That version of the plugin is available in the WordPress plugin repo now.
Thank you so much! Confirmed this has resolved the issue.
Issue with this error is happening again. Getting the same error when trying to edit posts/pages.
Hey Phillip, I can’t reproduce this one. Can you confirm
- The exception message (the text in the console)
- Which version of the plugin you’re using
- Which version of wordpress you’re using
- Which editor you’re using (Gutenberg or Classic)
Could you also share the value of the setting “Post Types to Publish” in “Publishing”? (take a screenshot of the setting if possible).
I’ll push a fix for this shortly so you can use the plugin again, but the reason I need to know a bit more (and the reason this is not appearing elsewhere) is that the immediate issue is indicative of another issue, and the immeidate band aid will obscure that other issue.
@alchemyandaim There’s a PR open to fix the immediate issue: https://github.com/discourse/wp-discourse/pull/386. In addition to sharing the “Post Types to Publish” setting could you clarify something for me?
It’s not possible to get the exception you’ve quoted in the classic editor (the relevant code isn’t loaded in the classic editor at all). Are you sure you’re seeing an error in the classic editor? If so could you share that error?
The classic editor is the one that looks like this
Here is the screen shot you requested.
Also I did just verify that the problem occurs in only Gutenberg editor. Classic is okay.
Thanks. And you’re only seeing the exception occur when attempting to edit normal wordpress posts? Does it occur when you’re attempting to
- create posts?
- create pages?
- edit pages?
- when you’re creating or editing anything else?
Thanks for your help on this. I’d like to get to the bottom of it, as opposed to just applying the band aid (which we will also do shortly) as that’ll make for greater stability over the long term.
Error occurs when creating or editing pages only. Posts are fine.
Thanks Angus! The PR has been merged into the master branch and pushed to the WordPress plugin repo.
@alchemyandaim, updating to WP Discourse 2.2.1 from your WordPress dashboard should fix the issue for you.
Confirmed this fixed the issue! thanks guys and happy holidays!