[geeklog-devel] Site breaks when there is one or more upcoming event?

Joe Mucchiello joe at ThrowingDice.com
Thu Mar 6 14:39:47 EST 2008


At 01:00 PM 3/6/2008, Blank, Jessica wrote:

>However, when I call it like this:
>func('MyX', 'MyY', NULL);

Well of course that fails. NULL is not an array. Nor it NULL "not a 
parameter".  The second test case is supposed to be

func('MyX','MyY');

Thus the bug is not in COM_createLink but in the phpblock_calendar. 
This (around line 247 of plugins/calendar/functions.inc from CVS 
about a week old):

     if( $todaysEvent ) {
         $attr = array('class' => $todaysClassName);
     }

     $newevent = COM_createLink(
         stripslashes( $theEvent['title'] ),
         $newevent_url,
         $attr
         );

The $attr needs initialization. I didn't use an else under the 
assumption that in the future there could be other conditions that 
add attributes independent of $todaysEvent:

     $attr = array();
     if ($todaysEvent) {
         $attr['class'] =>$todaysClassName;
     }

----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com 




More information about the geeklog-devel mailing list