Bug #17551
openEvents Calendar view
Added by scott voth almost 2 years ago. Updated 6 months ago.
0%
Description
When I switch from "List View" to "Calendar View" I get a "Loading" icon spinning around. In debugger seems like some CORS issue.
I wanted to get some screenshots of December events, so I "back arrowed" to December. When I go back to list view everything is fine. But I am still in January, not December.
Files
calendar view.jpg (98.1 KB) calendar view.jpg | scott voth, 2023-01-24 04:43 PM | ||
list-view.jpg (128 KB) list-view.jpg | Raymond Hoh, 2023-02-02 01:44 AM | ||
Events (logged In) Calendar view.jpg (397 KB) Events (logged In) Calendar view.jpg | Sara Cannon, 2023-02-05 11:53 PM | ||
Events (logged In) List view.jpg (918 KB) Events (logged In) List view.jpg | Sara Cannon, 2023-02-05 11:53 PM |
Updated by Boone Gorges almost 2 years ago
- Assignee set to Raymond Hoh
I don't think it's a CORS issue. It seems that a fatal error is being triggered. Here's the stack trace:
[Tue Jan 24 19:27:14 2023] [error] [pid 67635] sapi_apache2.c(349): [client 98.226.143.241:41598] PHP Fatal error: Uncaught Exception: Error in formating DateTime object. Expected DateTime, but instead given boolean in /var/www/html/commons/www/wp-content/plugins/event-organiser/includes/event-organiser-utility-functions.php:31\nStack trace:\n#0 /var/www/html/commons/www/wp-content/plugins/event-organiser/includes/event-organiser-utility-functions.php(165): eo_format_datetime()\n#1 /var/www/html/commons/www/wp-content/plugins/event-organiser/includes/event-organiser-ajax.php(179): eo_format_event_occurrence()\n#2 /var/www/html/commons/www/wp-includes/class-wp-hook.php(308): eventorganiser_public_fullcalendar()\n#3 /var/www/html/commons/www/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()\n#4 /var/www/html/commons/www/wp-includes/plugin.php(517): WP_Hook->do_action()\n#5 /var/www/html/commons/www/wp-admin/admin-ajax.php(188): do_action()\n#6 {main}\n thrown in /var/www/html/commons/www/wp-content/plugins/event-organiser/includes/event-organiser-utility-functions.php on line 31
It seems that this is a bug in EO. See https://github.com/stephenharris/Event-Organiser/issues/526. Possibly also related to https://github.com/stephenharris/Event-Organiser/pull/484, #12847 . Here's a request that triggers it, though note that it doesn't trigger it on every pageload - maybe a cache issue? https://commons.gc.cuny.edu/wp-admin/admin-ajax.php?action=eventorganiser-fullcal&start=2022-12-26&end=2023-02-06&timeformat=g%3Ai%20a&scope=all&bbgd=1
Ray, could you spend a minute looking at this? I think that, as described in your GitHub ticket, this is a case where the event is corrupted in the DB, so I'm wary of putting a bandaid over it.
Updated by Raymond Hoh almost 2 years ago
Ray, could you spend a minute looking at this? I think that, as described in your GitHub ticket, this is a case where the event is corrupted in the DB, so I'm wary of putting a bandaid over it.
I think this is related to the Advanced Post Cache plugin we are using on production. On production, I've temporarily added some code to exclude the 'event'
post type from the Advanced Post Cache plugin in this existing callback filter: https://github.com/cuny-academic-commons/cac/blob/759c8c2fa85f48f449bde8ebdb2bb0b39c4a78c8/wp-content/mu-plugins/cac-functions.php#L3286.
Since I've added the code and after refreshing the sample AJAX request URL about a dozen times, I haven't been able to trigger the fatal error. Once I get some confirmation that this is working for others, I'll commit the fix.
Updated by Colin McDonald almost 2 years ago
I haven't been able to reproduce this now, either. Scott, does it seem fixed to you?
Updated by scott voth almost 2 years ago
Hi Colin - I no longer get the fatal error. But when I switch to calendar view and go to December (where there are a lot of events) and then switch to List view I get taken back to January events. I was hoping to take a screenshot of the list view when there are a lot of events.
Updated by Raymond Hoh almost 2 years ago
Thanks for testing, Colin and Scott. I've committed the fix for the event calendar AJAX problem: https://github.com/cuny-academic-commons/cac/commit/96296f4c392005163f4fed5db5e0b989f40696e9 .
I'll let Boone handle the list view issue that Scott mentioned in comment 4. I also noticed some bugs with recurring events. See #17587.
Updated by Boone Gorges almost 2 years ago
Thanks for having a look, Ray.
Hi Colin - I no longer get the fatal error. But when I switch to calendar view and go to December (where there are a lot of events) and then switch to List view I get taken back to January events. I was hoping to take a screenshot of the list view when there are a lot of events.
List view only shows upcoming events. There's no way to view a previous month's events in list view. This is a limitation of how Event Organiser works.
Updated by Raymond Hoh almost 2 years ago
List view only shows upcoming events. There's no way to view a previous month's events in list view. This is a limitation of how Event Organiser works.
It looks like it is possible to view previous month's events in list view. Event Organiser has an archive view and when using the following permalink, you can view all 2022 events: /events/event/on/2022/
. For monthly permalinks such as December 2022: /events/event/on/2022/12/
. We just need to style the event archive template to resemble our list view and and expose some type of monthly pagination. What might complicate things is our custom scope filters for campus events, featured events and the current user's events.
Will see what is possible.
Updated by Raymond Hoh almost 2 years ago
- File list-view.jpg list-view.jpg added
It looks like it is possible to view previous month's events in list view. Event Organiser has an archive view and when using the following permalink, you can view all 2022 events: /events/event/on/2022/. For monthly permalinks such as December 2022: /events/event/on/2022/12/. We just need to style the event archive template to resemble our list view and and expose some type of monthly pagination. What might complicate things is our custom scope filters for campus events, featured events and the current user's events.
I've got some updates ready for testing on cdev. You will need to do a hard refresh or purge your browser's cache to properly see the updates.
- You can now view specific months in calendar view by URL. For example on cdev, you can go to:
https://commons.gc.cuny.edu/events/?view=calendar&ey=2023&em=01
. And this will display January 2023 in calendar view. Calendar view is also updated so the List View button will work properly. - You can now view specific months in list view by URL. For example on cdev, you can go to:
https://commons.gc.cuny.edu/events/event/on/2023/01/
. And this will display January 2023 in list view. See attached screenshot. List View is accomplished by overriding the various archive templates from Event Organiser to resemble our new design. Monthly pagination also works much like calendar view.
Commits: https://github.com/cuny-academic-commons/cac/compare/425f0d7...109d8ce
Some implementation todos / notes:- I haven't implemented the Filters from the main Events Directory page in List View yet.
- For the Events Directory page, we might want to change the heading from "Events" to "Upcoming Events".
- I also wasn't sure if we wanted to keep the "All Events" and "My Events" nav buttons when in Monthly List View because those buttons might imply that those nav buttons are applicable for that month. I've kept them for now.
- Likewise, I think the counts for "All Events" and "My Events" are confusing because those counts encompass all events ever created. I would probably recommend removing the counts entirely as I'm not sure if the count has any utility.
Updated by Boone Gorges almost 2 years ago
Thanks for looking into this, Ray.
Likewise, I think the counts for "All Events" and "My Events" are confusing because those counts encompass all events ever created. I would probably recommend removing the counts entirely as I'm not sure if the count has any utility.
I agree with this.
The navigation flow with your changes doesn't feel quite right to me. When you land on https://commons.gc.cuny.edu/events/, you see the Upcoming Events List view. If you toggle to Calendar, you see February 2023. If you then toggle back to List, you are now seeing February 2023 instead of Upcoming, and there's no way to get back to Upcoming.
IMHO, we don't want to lose access an at-a-glance list view of upcoming events, one that is not tied to a month. (1) Users browsing Events are probably more likely to be interested in future events than past ones. (2) Say it's February 26 and you go the list view. If it's linked to the month, you'll have to scroll through Feb 1-25 to get to upcoming events, and then you'll only see a few days' worth.
It would be nice to hear what Sara and Colin have to think about a list view for past events. I'm not personally convinced that it's necessary. The original problem in this ticket is that there was some confusion about the different behavior of Calendar vs List, but I wonder whether we can solve this with better labelling (changing "List" to "Upcoming" perhaps) instead of a functional change to list view.
Updated by Raymond Hoh almost 2 years ago
The navigation flow with your changes doesn't feel quite right to me.
Yeah I was thinking the same thing last night, but Scott's problem from comment 4 is an important flow question that we need to solve as well.
I had this thought when I woke up that the nav should change to the following:
- All Upcoming Events (is currently All Events)
- My Upcoming Events (is currently My Events)
- Calendar (new nav item) (Could be renamed to something else like "Monthly Events" or "View by month"). This would default to the calendar view and would solve most of the flow issues you mention above.
In "All Upcoming Events" and "My Upcoming Events", we remove the List View and Calendar View icon buttons displayed on the right. The Calendar View icon button doesn't make much sense on these pages as it is just a calendar and has buttons to view older and future months. Having a dedicated "Calendar" nav item would solve the issue and would retain the List View and Calendar View icon buttons.
What does everyone think?
I wonder whether we can solve this with better labelling (changing "List" to "Upcoming" perhaps) instead of a functional change to list view.
This would also solve Scott's problem. The "List" button right now on production is doing double duty as an Upcoming Events list, so that's where the confusion lies although I do see the utility of having a monthly list view.
Updated by Colin McDonald almost 2 years ago
I'm adding Matt as a watcher here, because we discussed this during the Friday dev call and I'm not sure if I'm going to transfer his feedback correctly (I think one or two of the latest thread updates came in after that conversation, also).
I like Ray's idea about changing nav labeling, both easier than changing functionality and perhaps more clear. I wonder if we can go with "All Upcoming" and "My Upcoming" and drop the extra "Events" appendages, especially since Events is the header label and you know you're already on the Events page. "Calendar" works for me as the third label, but I could also see something like "Grid View" or "Event Grid."
Would it also help, regarding the prior events issue/desire we've discussed, to simply add arrows at the bottom where relevant for "Previous Events" and "Next Events" kind of like in this similar view (which I think is using a similar plugin setup as ours)?
https://www.green-wood.com/calendar/photo/
I guess in our case right now we'd only have a "Previous Events" arrow, taking one back in the list view as that link does, and when we're more populated with upcoming events we'd have the Next Events link appear when we hit our max display number for the main Events page.
Updated by Sara Cannon almost 2 years ago
- File Events (logged In) Calendar view.jpg Events (logged In) Calendar view.jpg added
- File Events (logged In) List view.jpg Events (logged In) List view.jpg added
Here are some designs that reflect the navigation discussion
- All Upcoming
- My Upcoming
- View Calendar
Updated by Raymond Hoh almost 2 years ago
On cdev, I've made changes to the event navigation and also fixed the following bugs:
- Fixed "All Upcoming" and "My Upcoming" event count to only use upcoming events for the count, as well as including recurring events
- Fixed "My Upcoming" page to include your upcoming group events
- Fixed event date and time display on single event pages. Was previously displaying "January 1, 1970".
I guess in our case right now we'd only have a "Previous Events" arrow, taking one back in the list view as that link does, and when we're more populated with upcoming events we'd have the Next Events link appear when we hit our max display number for the main Events page.
It might be possible to do something about this in list view, however it's worthwhile to note that we already have two types of pagination:
- In either Upcoming or Calendar List view, if there are more than 10 events on a page, there will be a pagination block displayed at the bottom. (Side note: We currently display four events per row. Should we change the pagination to 12 or 16 so the list view is uniform?). If we were to include the "Previous Events" arrow, would we have two sets of pagination at the bottom?
- If you are in calendar list view, the date header on this page has arrows to go to the previous month or the next month. Right now, if you click on the previous month arrow, it will just go back one month sequentially even if that month has no events. Perhaps the previous arrow should traverse to the previous month that has events instead?
Updated by Colin McDonald almost 2 years ago
Hi Ray, thanks for thinking through these nav and pagination issues. It seems to me that we should definitely change the 10 default list items across 4-wide rows. I'm thinking 16 to balance it all out.
For pagination, what if it's just Previous Events and Next Events at the bottom? I don't see people getting a lot of utility out of the current numbered pagination options for skipping ahead, anyway.
On the date header, I think it would be confusing if you click the previous month header and don't go back sequentially, but instead hop way back to a month with populated events. Hopefully this won't be as much of an issue once we have events being added more regularly though, and we'll have at least something archived for every month.
Let's also remove the "location" line item from the tiles on list view (I think it's already not showing on calendar view?), so it isn't confusing as we discussed in the dev call whether this line means campus affiliation or actual location. That is more clear to see in the single event full view.
Updated by Boone Gorges about 1 year ago
- Target version changed from 2.2.0 to 2.3.0
Updated by Boone Gorges 10 months ago
- Target version changed from 2.3.0 to 2.4.0
Updated by Boone Gorges 6 months ago
- Target version changed from 2.4.0 to 2.5.0