Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8026 Posts in 1851 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: FOREACH EVENTLIST bug #2  (Read 353 times)
0 Members and 1 Guest are viewing this topic.
kunci
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: January 11, 2006, 01:56:00 AM »

$EventList, used to sort events for use with FOREACH EVENTLIST loop, is not initialized in getEvents() (unlike $Grid).  The effect of that is that if the template calls getEvents() more than once with different values for range, the loop will return the events matching the largest range previously specified.  Clear as mud?  How about an example...  

I have a "combo" template, where I always show a small month calendar using getEvents({range=>'month'}) and FOREACH GRID ROW/FOREACH GRID COLUMN loops.  On the right (main area) I show the list of events that can be specified for a selected day, week, or month; this is achieved using getEvents( ... ) and FOREACH EVENTLIST/FOREACH EVENT loops, and the range is passed as a CGI parameter.  The list on the right would always show the events for the entire month, regardless of selected range, because $EventList would be filled out at the first pass through getEvents(), when the entire month is retrieved (so that the small grid can be displayed), and subsequent passes simply overwrite the same info for a subset of existing entries; the remaining, irrelevant entries remain in the hash.  

I fixed that by adding

my ($EventList);

in calendar.pl, right after

my ($Grid)

(line 640 in version 3.21).

Logged
Pages: [1]   Go Up
Print
Jump to: