The existing code was considering as a current event any event that had started less than 2 hours from the current time, ignoring the event's end time, and thus wrongly marking with 'NOW' some events that had already finished within those 2 hours. This patch fixes this.
This patch also makes sure that the database queries never return more events than needed for the block.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | event_upcoming.patch | 4.72 KB | david lesieur |
| #15 | event.module.rej.txt | 4.86 KB | Chris_Allen |
| #13 | event.patch_2.txt | 4.71 KB | killes@www.drop.org |
| #6 | upcoming_events.patch | 4.53 KB | david lesieur |
| event.module_45.patch | 3.74 KB | david lesieur |
Comments
Comment #1
killes@www.drop.org commentedWhy cant you use the upcoming events hook to unset the events you dont want to display? I don't like this patch much as it introduces a new query.
Comment #2
david lesieur commentedYes, I could use the hook, but isn't showing finished events in this block clearly a bug? Also, the current logic causes a current event not to be shown if it has started more than 2 hours before the current time, which IMHO is another bug.
Sure, the two queries could be combined, I'll do this.
Comment #3
david lesieur commentedComment #4
TSE commentedthis sounds great, exacltly solving the problems i had. but one (silly) question.
how do i apply your patch, i mean is there a program which handles this or do i have to do it by hand ?
Comment #5
david lesieur commented@TSE: See how to apply patches.
Comment #6
david lesieur commentedImproved patch, using a single query.
Comment #7
david lesieur commentedComment #8
TSE commentedhi david
works perfect, many thanx for your great work
TSE
Comment #9
whatistocome commentedi too can verify that this worked as intended.
- Jason
Comment #10
david lesieur commented@killes: I think #6 takes care of your initial concerns, others have tested the patch, and it still applies. Shall this be committed? Thanks.
Comment #11
TSE commentedplease commit it !!! dont wanna apply this patch every time i update the event.module ;)
thX in advance
Comment #12
killes@www.drop.org commentedthe problem with this patch is that as soon as an event starts it drops off the list, if it does not have a specific end date. We use end date == start date for all day events. Thes would vanish as soon as they start.
Comment #13
killes@www.drop.org commentedHow about this patch? It will show events that don't have a specific end date for two hours after start.
Comment #14
david lesieur commentedGood point, good patch! :-)
Comment #15
Chris_Allen commentedI tried to apply this patch (#13 event.patch_2.txt) but got this error:
patching file `event.module'
patch unexpectedly ends in middle of line
Hunk #1 FAILED at 1746.
1 out of 1 hunk FAILED -- saving rejects to event.module.rej
I have already applied event.module_45.patch. Running Windows XP with apache triad and Drupal 4.7
I've attached the .rej file - if that helps.
Comment #16
david lesieur commentedChris: To apply the patch, make sure to start from a fresh event.module.
Comment #17
gerhard killesreiter commentedDavid, did you test the patch?
Comment #18
david lesieur commentedOops, the patch applied, but had a typo in a query. Now fixed and properly tested. ;-)
Comment #19
killes@www.drop.org commentedthe patch was already in 4.7 and is not in HEAD too. will be in 5 soon.
Comment #20
(not verified) commented