Enabling the Calendar plugin disables sorting by Replies and Views in Latest

AI-generated summary

A user, icaria36, reported an issue with the Calendar plugin, where enabling it disables sorting by Replies and Views in the Latest section. JammyDodger suspected it might be intentional, tracing the issue to a line of code. However, icaria36 discovered that the intended behavior was to disable other sorting methods only when sorting by start event date is enabled. Currently, sorting by other means is disabled regardless, which seems to be a bug. The issue was confirmed by frank.manuel, who pushed a fix to the discourse-calendar repository.

What the title says. :slight_smile:

By default, topics in Latest can be sorted by Replies and Views, clicking the list headers. However, simply enabling calendar enabled in the settings disables these optional ways of sorting. You don’t even need to create a calendar-enabled post to trigger the change. If you disable the plugin, Replies and Views are clickable again.

Is this a bug or intended design? There doesn’t seem to be a relation between plugin and Latest sorting from a user point of view, and the Latest sorting feature is just as useful with Calendar enabled.

2 Likes

This cropped up the other day, but I can’t quite find where I read it. :slightly_smiling_face:

From what I recall, it’s actually a line in the code that seems to do it on purpose. I’ll see if I can dig up more information. :+1:


Update: @icaria36

I think it was recently added here:

1 Like

If I’m following the commit history correctly, the intended behavior is that, when sorting by start event date is enabled, then sorting by other means should be disabled. This means total sense.

https://github.com/discourse/discourse-calendar/pull/320

However, right now sorting by other means is disabled regardless of whether sorting by start event date is enabled or not. This doesn’t seem to be the intended behavior, so maybe this is a bug indeed.

3 Likes

Hi @icaria36! You are right, this is indeed a bug.

I’ve pushed the fix to discourse-calendar just now.

Thanks for your report!

3 Likes

This topic was automatically closed after 24 hours. New replies are no longer allowed.