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.

Comments

killes@www.drop.org’s picture

Why 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.

David Lesieur’s picture

Yes, 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.

David Lesieur’s picture

Status: Needs review » Needs work
TSE’s picture

this 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 ?

David Lesieur’s picture

David Lesieur’s picture

StatusFileSize
new4.53 KB

Improved patch, using a single query.

David Lesieur’s picture

Status: Needs work » Needs review
TSE’s picture

hi david

works perfect, many thanx for your great work

TSE

whatistocome’s picture

i too can verify that this worked as intended.

- Jason

David Lesieur’s picture

Status: Needs review » Reviewed & tested by the community

@killes: I think #6 takes care of your initial concerns, others have tested the patch, and it still applies. Shall this be committed? Thanks.

TSE’s picture

please commit it !!! dont wanna apply this patch every time i update the event.module ;)

thX in advance

killes@www.drop.org’s picture

the 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.

killes@www.drop.org’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new4.71 KB

How about this patch? It will show events that don't have a specific end date for two hours after start.

David Lesieur’s picture

Good point, good patch! :-)

Chris_Allen’s picture

StatusFileSize
new4.86 KB

I 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.

David Lesieur’s picture

Chris: To apply the patch, make sure to start from a fresh event.module.

gerhard killesreiter’s picture

David, did you test the patch?

David Lesieur’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new4.72 KB

Oops, the patch applied, but had a typo in a query. Now fixed and properly tested. ;-)

killes@www.drop.org’s picture

Status: Reviewed & tested by the community » Fixed

the patch was already in 4.7 and is not in HEAD too. will be in 5 soon.

Anonymous’s picture

Status: Fixed » Closed (fixed)