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)
at https://fpadvance.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:53:49
Here is the exception message…
TypeError: Cannot read property ‘split’ of undefined
at DiscourseSidebar.buildPostState (index.js:694)
at DiscourseSidebar.initializePostState (index.js:675)
at new DiscourseSidebar (index.js:606)
at Ag (react-dom.min.js?ver=16.9.0:63)
at Vg (react-dom.min.js?ver=16.9.0:89)
at ph (react-dom.min.js?ver=16.9.0:217)
at lh (react-dom.min.js?ver=16.9.0:126)
at O (react-dom.min.js?ver=16.9.0:121)
at ze (react-dom.min.js?ver=16.9.0:118)
at react-dom.min.js?ver=16.9.0:53
Plugin version is 2.2.0
WP version 5.5.3
Error occurs in both Classic and Gutenberg editors.
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.
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
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.