[dev] Kronolith bug in lib/Driver/sql.php

David U. davidu@everydns.net
Mon, 16 Sep 2002 08:53:11 -0500


I think that the new getEventObject in lib/Driver/sql.php has a bug with new
objects because of this:

line 153:        $eventID = (int)$eventID;

What happens is that when getEventObject is called with no $eventID it
should make a new one however the line above converts a null into a 0 this
"giving it a value" and thinking it should return an event instead of
creating a new one.

I fixed it with this:
        if(!empty($eventID)) {
            $eventID = (int)$eventID;
        }

but I'm sure there's a better way. Why is it being casted to an int? Isn't
it an int already?

-davidu


--
"Never doubt that a small group of thoughtful citizens can change the
world. Indeed, it is the only thing that ever has." --Margaret Mead