Category not loading through direct link when log out

Good day,

I’ve just made a new installation of Discourse here: https://club.magiaycardistry.com/

I want to add a link to this sub category in my main website: ✅ Preguntas frecuentes - Club Magia&Cardistry

The problem is that if I try to access the link loged out, the website seems to break and fail. But if I access that sub category with the sidebar menu, there is no problem.

Here is a video:

And here the console errors:

TypeError: Cannot read properties of undefined (reading 'find')
    at e.setupController (build-category-route.js:116:1)
    at e.setup (route.js:791:1)
    at s (router_js.js:1514:1)
    at l.routeEnteredOrUpdated (router_js.js:1524:1)
    at l.setupContexts (router_js.js:1470:1)
    at l.finalizeTransition (router_js.js:1378:1)
    at router_js.js:1321:1
    at y (rsvp.js:435:1)
    at v (rsvp.js:421:1)
    at p.invoke (queue.ts:203:14)
    at p.flush (queue.ts:98:13)
    at h.flush (deferred-action-queues.ts:75:19)
    at q._end (index.ts:616:32)
    at _boundAutorunEnd (index.ts:257:12)
error @ application.js:78
router.js:1064 Error while processing route: discovery.category Cannot read properties of undefined (reading 'find') TypeError: Cannot read properties of undefined (reading 'find')
    at e.setupController (https://club.magiaycardistry.com/assets/discourse-ff773a6a7f76fb963664b1127e38b3761b6b158e4bc255aa479efe069faaba37.js:7193:85)
    at e.setup (https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:1611:63)
    at s (https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:4221:141)
    at l.routeEnteredOrUpdated (https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:4221:225)
    at l.setupContexts (https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:4220:41)
    at l.finalizeTransition (https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:4212:13)
    at https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:4205:243
    at y (https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:4286:12)
    at v (https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:4284:128)
    at p.invoke (https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:4373:192)
    at p.flush (https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:4365:141)
    at h.flush (https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:4380:207)
    at q._end (https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:4444:9)
    at _boundAutorunEnd (https://club.magiaycardistry.com/assets/vendor-193f5cd259e36a4d2a864bbb1b9e24ea91298f102a56e7119b2fd7cb5c04cf42.js:4392:595)
(anonymous) @ router.js:1064
build-category-route.js:116 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'find')
    at e.setupController (build-category-route.js:116:1)
    at e.setup (route.js:791:1)
    at s (router_js.js:1514:1)
    at l.routeEnteredOrUpdated (router_js.js:1524:1)
    at l.setupContexts (router_js.js:1470:1)
    at l.finalizeTransition (router_js.js:1378:1)
    at router_js.js:1321:1
    at y (rsvp.js:435:1)
    at v (rsvp.js:421:1)
    at p.invoke (queue.ts:203:14)
    at p.flush (queue.ts:98:13)
    at h.flush (deferred-action-queues.ts:75:19)
    at q._end (index.ts:616:32)
    at _boundAutorunEnd (index.ts:257:12)

I am new to Discourse and I might have done something wrong.

Thank you for your help.
Julio.

1 Like

Hi @illusionandcards - thanks for the report! It looks like this error is related to a fairly new feature, which is controlled by the ‘default subcategory on read only category’ site setting which you’ve enabled.

We’re digging into the problem and will make a fix, but in the meantime I think you’ll be able to get things working by turning that setting off. Can you give it a try and let us know if it works?

3 Likes

Yes! That solved the problem. Thank you very much David.

3 Likes

Hi, the problem for non logged in users has been solved here FIX: Fix for Default to subcategory when parent category does not allow posting by jdmartinez1062 · Pull Request #21537 · discourse/discourse · GitHub. Let us know if you encounter any issues.

This topic was automatically closed after 2 days. New replies are no longer allowed.