Gauravk Posted April 6, 2021 Posted April 6, 2021 We have just upgraded to 4.5 today and first bug encountered is in calendar sidebar widget.It's showing events in wrong order (unlike before). AM events should appear before PM events.Support acknowledge and reported the bug with indefinite timeline. We need urgent help please with some coding tweak or patch, as we have many events every week and this confusion will irritate our members.
CoffeeCake Posted April 7, 2021 Posted April 7, 2021 Have you asked for the changes from support? My guess would be that the fix is in application/calendar/sources/Event/Event.php in the sorting that happens in the retrieveEvents function, however that's a total and complete guess. 🙂
Gauravk Posted April 7, 2021 Author Posted April 7, 2021 Yes I did asked support but they cant provide any assistance for their own bug and we have to wait indefinitely. Sad but true. Thanks for pointing in at least 1 file out of 20K files. I'm happy to pay, if someone can fix this 1 bug, please PM me.
CoffeeCake Posted April 7, 2021 Posted April 7, 2021 Just now, Gauravk said: Yes I did asked support but they cant provide any assistance for their own bug and we have to wait indefinitely. Why you gotta be that way, guys? @Jordan Invision Gauravk 1
Nathan Explosion Posted April 7, 2021 Posted April 7, 2021 27 minutes ago, Gauravk said: Thanks for pointing in at least 1 file Funnily enough, as it is a Widget in the Calendar app, and it's the "Upcoming events", there is an obvious file to look at as a starting point... application\calendar\widgets\upcomingEvents.php And in there, the following line gets the list of events: $events = \IPS\calendar\Event::retrieveEvents( $_today, $endDate, ( $calendars === NULL ? NULL : !\is_array( $calendars ) ? array( $calendars ) : $calendars ), $count, FALSE ) Which directs you to applications\calendar\sources\Event\Event.php, where the retrieveEvents function lives. And it contains 264 lines of code (or more, or less, depends on your IDE and settings) to look through. And that takes more time to do...and would require it to be sent to the developers, not the front-line support guys, to work on and will take them away from already existing work they are doing on v4.6. If I have the time later, then I'll look through that code but NO promises at all being given here. 35 minutes ago, CoffeeCake said: Why you gotta be that way, guys? @Jordan Invision Don't set a precedent. Gauravk 1
Gauravk Posted April 7, 2021 Author Posted April 7, 2021 Thanks @Nathan Explosion for saving me tons of hassle as I'm not a coder but I was about to jump on that file to do some roulette luck or hacking out of sheer desperation. After reading your 264 line of codes, I would rather pray or pay until someone helps.
Nathan Explosion Posted April 7, 2021 Posted April 7, 2021 (edited) Removed direct code edit information Edited April 7, 2021 by Nathan Explosion Plugin added down below SeNioR- and Gauravk 1 1
Gauravk Posted April 7, 2021 Author Posted April 7, 2021 SUPER AWESOME THANKS A TON, @Nathan Explosion It really worked. The Old Man 1
Nathan Explosion Posted April 7, 2021 Posted April 7, 2021 No worries - if I can spot a way to do this without a code edit (ie via a plugin) then I will change the above. If you do want to donate to my beer fund then ping me a pm 😄 Gauravk 1
Nathan Explosion Posted April 7, 2021 Posted April 7, 2021 (edited) @Gauravk remove that direct edit of the widget file, and use this plugin instead. EDIT: updated plugin to force the usort to only run when the upcomingEvents widget is the item calling the function (NE) Re-sort Upcoming Events widget_1.0.1.xml Edited April 13, 2021 by Nathan Explosion updated plugin to force the usort to only run when the widget is used kmk, Ramsesx, Chris Anderson and 2 others 2 3
Gauravk Posted April 7, 2021 Author Posted April 7, 2021 Cheers @Nathan Explosion this xml plugin also works perfectly. Hope this help others too in the future. Nathan Explosion and The Old Man 2
IP-Gamers Posted April 22, 2021 Posted April 22, 2021 I know one thing. When I set the scan for seven hundred days instead of seven in the upcoming events widget, all those pages where this widget stood began to load for a very long time. And because of this I swore the technical support of the hosting. 😆
Recommended Posts