alleyinteractive / archiveless

WordPress plugin to hide posts from archives (lists)
GNU General Public License v2.0
7 stars 4 forks source link

Custom post types error out on latest. #20

Closed jameswburke closed 3 years ago

jameswburke commented 3 years ago

Steps to reproduce:

TypeError: Cannot read property 'archiveless' of undefined
    at t.value (https://twoscrumsup.alleyinteractive.alley.test/wp-content/plugins/archiveless/build/pluginSidebar.js?ver=1596925298:1:3148)
    at re (https://twoscrumsup.alleyinteractive.alley.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:95:261)
    at Vg (https://twoscrumsup.alleyinteractive.alley.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:95:54)
    at ph (https://twoscrumsup.alleyinteractive.alley.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:217:70)
    at lh (https://twoscrumsup.alleyinteractive.alley.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:126:409)
    at O (https://twoscrumsup.alleyinteractive.alley.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:121:71)
    at ze (https://twoscrumsup.alleyinteractive.alley.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:118:14)
    at https://twoscrumsup.alleyinteractive.alley.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:53:49
    at unstable_runWithPriority (https://twoscrumsup.alleyinteractive.alley.test/wp-includes/js/dist/vendor/react.min.js?ver=16.9.0:26:340)
    at Ma (https://twoscrumsup.alleyinteractive.alley.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:52:280)

Screenshot: Screen Shot 2020-08-08 at 6 21 48 PM

Fixing the JS error, but Archiveless still doesn't work: I've pushed up #19 to show off how the JS error can be fixed (by ensuring we're not deconstructing a nested undefined), however if you try to set the archiveless toggle and publish/update, the toggle will become false, and the archiveless status does not stick.

renatonascalves commented 3 years ago

For the post type to work, it needs support for the supports' => [ 'custom-fields' ], so at #21 we are removing it for post types without it.