Subcategory Calendar topic list issue

Calendar view no longer displays, multiple errors are logged after the latest update to discourse-events plugin

Steps to reproduce:

  • switch to category that has calendar view enabled by default
    • agenda view is displayed instead
  • click the calendar view button
    • the view is opened but the monthly calendar itself is missing (blank page)
    • the subscribe button is also missing
  • refresh the browser
    • now even the forum header is gone

Logs:

Message (2 copies reported)

Uncaught ReferenceError: discourseComputed is not defined
Url: https://discourse.forum.tld/assets/plugins/discourse-events-06ac35d5a7f0959073ce15f60d54993b200aa4c222c95acbff109dfeb9faa76b.js
Line: 1
Column: 110761
Window Location: https://discourse.forum.tld/c/category/subcategory/20/l/calendar

Backtrace

ReferenceError: discourseComputed is not defined
    at https://discourse.forum.tld/assets/plugins/discourse-events-06ac35d5a7f0959073ce15f60d54993b200aa4c222c95acbff109dfeb9faa76b.js:1:110761
    at t.module.exports.u.<computed> (https://discourse.forum.tld/assets/ember_jquery-57d09ec67e9e407d9b0d42aa1fefd1a470c45310d953b07793a3ca8adc6ec599.js:1:561763)
    at t.module.exports.u.<computed> (https://discourse.forum.tld/assets/ember_jquery-57d09ec67e9e407d9b0d42aa1fefd1a470c45310d953b07793a3ca8adc6ec599.js:1:561476)
    at require (https://discourse.forum.tld/assets/ember_jquery-57d09ec67e9e407d9b0d42aa1fefd1a470c45310d953b07793a3ca8adc6ec599.js:1:561493)
    at t.customResolve (https://discourse.forum.tld/assets/application-002fac0f908ce3717febeec69c3bb7baf56735b7a4600ef27e09debfd6a6aa97.js:1:33747)
    at t.resolveComponent (https://discourse.forum.tld/assets/application-002fac0f908ce3717febeec69c3bb7baf56735b7a4600ef27e09debfd6a6aa97.js:1:34318)
    at t.n.resolve (https://discourse.forum.tld/assets/ember_jquery-57d09ec67e9e407d9b0d42aa1fefd1a470c45310d953b07793a3ca8adc6ec599.js:1:321797)
    at https://discourse.forum.tld/assets/ember_jquery-57d09ec67e9e407d9b0d42aa1fefd1a470c45310d953b07793a3ca8adc6ec599.js:1:95636
    at e.t.resolve (https://discourse.forum.tld/assets/ember_jquery-57d09ec67e9e407d9b0d42aa1fefd1a470c45310d953b07793a3ca8adc6ec599.js:1:95742)

Env

HTTP HOSTS: discourse.forum.tld
Message (5 copies reported)

ApiKey::KeyAccessError (API key is only accessible immediately after creation)
/var/www/discourse/app/models/user_api_key.rb:37:in `key'

Backtrace

/var/www/discourse/app/models/user_api_key.rb:37:in `key'
/var/www/discourse/plugins/discourse-events/controllers/api_keys.rb:19:in `index'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.1/lib/abstract_controller/base.rb:196:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.1/lib/action_controller/metal/rendering.rb:30:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.1/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:135:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.1/lib/abstract_controller/callbacks.rb:41:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.1/lib/action_controller/metal/rescue.rb:22:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.1/lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'

Env

HTTP HOSTS: discourse.forum.tld
Message (2 copies reported)

Uncaught [object Object]
Url: https://discourse.forum.tld/assets/ember_jquery-57d09ec67e9e407d9b0d42aa1fefd1a470c45310d953b07793a3ca8adc6ec599.js
Line: 1
Column: 267440
Window Location: https://discourse.forum.tld/c/category/subcategory/20/l/calendar

Backtrace



Env

HTTP HOSTS: discourse.forum.tld

All of this is fixed just now.

Can’t repro this. You can toggle the setting once and it should come back. Looks like a caching problem.

better, the previous errors are gone, but there is a new one:

Message

Uncaught TypeError: Cannot read property 'addEventListener' of null
Url: https://discourse.forum.tld/plugins/discourse-calendar/javascripts/fullcalendar-with-moment-timezone.min.js
Line: 8
Column: 1505
Window Location: https://discourse.forum.tld/c/category/subcategory/20/l/calendar

Backtrace

TypeError: Cannot read property 'addEventListener' of null
    at Object.i [as listenBySelector] (https://discourse.forum.tld/plugins/discourse-calendar/javascripts/fullcalendar-with-moment-timezone.min.js:8:1505)
    at e.bindHandlers (https://discourse.forum.tld/plugins/discourse-calendar/javascripts/fullcalendar-with-moment-timezone.min.js:11:9344)
    at e.render (https://discourse.forum.tld/plugins/discourse-calendar/javascripts/fullcalendar-with-moment-timezone.min.js:11:9113)
    at t.didUpdateAttrs (https://discourse.forum.tld/assets/plugins/discourse-calendar-aa26a264b9f5ec0b65fe70775ae8af70794606a37898d9fb3a6849e8ab24b2b2.js:1:47727)
    at t.e [as didUpdateAttrs] (https://discourse.forum.tld/assets/ember_jquery-57d09ec67e9e407d9b0d42aa1fefd1a470c45310d953b07793a3ca8adc6ec599.js:1:297014)
    at trigger (https://discourse.forum.tld/assets/ember_jquery-57d09ec67e9e407d9b0d42aa1fefd1a470c45310d953b07793a3ca8adc6ec599.js:1:318465)
    at t.e [as trigger] (https://discourse.forum.tld/assets/ember_jquery-57d09ec67e9e407d9b0d42aa1fefd1a470c45310d953b07793a3ca8adc6ec599.js:1:297014)
    at t.n.update (https://discourse.forum.tld/assets/ember_jquery-57d09ec67e9e407d9b0d42aa1fefd1a470c45310d953b07793a3ca8adc6ec599.js:1:139729)
    at e.evaluate (https://discourse.forum.tld/assets/ember_jquery-57d09ec67e9e407d9b0d42aa1fefd1a470c45310d953b07793a3ca8adc6ec599.js:1:433133)

Env

HTTP HOSTS: discourse.forum.tld

This seems to be coming from discourse-calendar plugin.

1 Like

True, but it only fires on the event enabled category. It seems that discourse-calendar had many changes recently and there is probably a conflict somewhere.

As I don’t really use the discourse-calendar right now I’ll uninstall it and report back.

1 Like

It’s confirmed, there is a compatibility issue between the two (calendar type) plugins, perhaps worth investigating before someone else steps on this mine.

This one is tricky :grin:, it turns out this bug only affects sub-categories. I had no event-enabled categories on the top level, and this is why I couldn’t figure it out at first:

  • I event-enabled the top level category for test and it works fine :wink:
  • opening the sub-category from Categories view directly (there is a link for subcategory under the parent category in this view) also works as expected :confused: :interrobang:
  • but opening the parent category first, and then opening the sub-category using the drop down menu (or clicking a subcategory link at the top of category, if displayed) opens the Agenda view (but the selected view button is Calendar) :partying_face:
    • clicking the Calendar view button opens the correct view.

I believe there was a bug report describing exactly this scenario before, perhaps this regressed somehow?

Edit: forgot to mention that events calendar view rendered properly only after disabling the discourse-calendar plugin.

1 Like


Resolved by this fix by the discourse team.

1 Like

Thanks for the update, did you have any luck identifying the cause for the subcategory display issue yet?

1 Like

Can you describe ONLY the issues which exist post the change made to discourse-calendar plugin in the OP?

1 Like

Description:

  • Default calendar view is not displayed properly in events-enabled subcategory when opening it from parent category

Steps to reproduce:

  • prepare subcategory, enable events, set Calendar view as default
  • go to Categories and open parent category first
  • open subcategory from the subcategories list above topic list (if enabled) or from the subcategory picker dropdown
  • subcategory opens with Calendar view set as active, but the Agenda view is displayed instead
  • upon selecting the Calendar view button again, the monthly calendar view appears

Note:

  • the correct view does open when opening the subcategory directly from Categories
  • top level categories display the Calendar view correctly
1 Like

Yes this is correct. Ideally it should go to the calendar.

Its hitting the calendar api in the backend but incorrect route when going there through the subcategory dropdown and hence the wrong template.

1 Like