Pagination for group calendars

I’ve been trying to work out how I can make the group calendars include pagination. I have the events_calendar widget set to 3 for testing purposes and it shows 3 events with pagination when there is no group, but not when there is a group. When there is a group, it shows 3 events but not the pagination. Here are two links.

no group - https://georgetown-dev.lwcal.com/
group - Web Services Test Calendar Events | Georgetown University

Hey Emma,

Thanks for sharing this – I see what you mean, other than the group= filter on the group calendar, all the other settings look the same, but for some reason the AJAX response is returning event_count=false rather than the total event number. We’ll take a look to see if we can reproduce this on one of our test servers to work on diagnosing and a fix. Thanks,

Karl

Thanks Karl! We’re getting quite a few complaints about this since our main calendar is a group calendar so you can’t get events beyond the default 10 except by switching to the month view.

Hi Emma,

A quick update for you:

We haven’t yet been able to reproduce the issue on our test servers, which could mean it’s no longer an issue in the latest release 2.19.0, or it’s a bug that only appears when certain calendar settings are combined.

Our team’s next steps are to see if we can reproduce the front-end settings we see on your calendar, can we get the issue to appear then. If not and it’s truly isolated to your calendar server, we may need to bring hands-on diagnosis out of the Forum and into Request Help.

In the meantime, we might suggest removing or raising that pagination limit so more events appear in the meantime until we’re able to help get to the bottom of this?

Thanks Emma!
Rachael

Hi Rachel,

Our development environment is on Version: 2.19.0, Build: 3.4.25.18.01-experimental so it’s not that.

  • Emma

Thanks for your patience – we’ve gotten to the bottom of this weird bug and patched a fix to your calendar!

Technical details: Whitespace (spaces and line breaks) in your calendar widget settings were erroneously getting passed through to the back-end code that returns results. The whitespace was properly trimmed before processing events results, but the logic that says “Take the last-returned Total Event Count from the database results and use that for pagination” wasn’t being found due to the mis-matched whitespace.

As a “thank you” for helping us identify this bug, we’ve gone ahead and patched the fix to your dev and prod calendar servers, Emma.


If anyone else is having this issue before 2.19.1+ gets released or you haven’t upgraded yet, a workaround you can do in your theme would be to remove extra line breaks from your calendar_settings.html widget, for instance replacing

<arg id="group">
  <xphp var="group_fullname" />
</arg>

with

<arg id="group"><xphp var="group_fullname" /></arg>

Thanks Karl! I can confirm that I’m seeing pagination on most calendars on both live and dev (which I back published) now. Working examples include https://events.georgetown.edu/, Georgetown University Medical Center Events | Georgetown University and School of Foreign Service Events | Georgetown University

One that is still not showing pagination is College of Arts & Sciences Events | Georgetown University There are at least another 8-9 upcoming events beyond the 10 that are displaying when you go to College of Arts & Sciences Events | Georgetown University One difference in this calendar is that there are a number of recurring events like the language conversation hours. Could this be the problem with this calendar?

Sure thing – it looks like you have <arg id="hide_repeats">true</arg> in your calendar settings, which will only show the next instance of a repeating or multi-day event in any given view. If you disable that via SFTP in your theming, all upcoming repeats of those events should show up there. Hope this helps!

Docs: Setting: hide_repeats - LiveWhale Support

Hi Karl,

I think there’s still something buggy going on. I changed the dev settings to hide_repeats false and show 3 per page and that one calendar is still now showing pagination and it should be. I’ve checked about 20 other calendars and they are all showing it when they have more than three upcoming events but this one isn’t College of Arts & Sciences Events | Georgetown University It’s not even showing all the events from the current day - College of Arts & Sciences Events | Georgetown University

Hi Emma,

Sorry to hear there’s still some trouble here for you. Ack! It looks like there aren’t any current upcoming events in the College of Arts & Sciences group on the dev site now. (Apologies for this post slipping through!) So I’m unable to check to see if the pagination is working in the “all” view for the group calendar.

However, taking a closer look at the day/date that you posted for April 22, it looks like four events were appearing then: College of Arts & Sciences Events | Georgetown University. Three single events showing at the top of the list, and one repeating event that’s getting added to the “Ongoing Events” section below when in the “day” view.

From testing on our installations (with the same calendar settings you’ve mentioned in this thread), that does appear to be the correct behavior of sorting in the “day” view and we’re still seeing the pagination in the “all” view.

If you’re able to add some additional events to the Arts & Sciences calendar and see that the pagination issue is present, we can certainly take a look again and see what we can find.

Keep us posted—thanks Emma!
Rachael