From: Andrew T. <ajt...@hi...> - 2006-04-07 20:23:03
|
Agreed, I've already changed the FOF_UNREAD_FLAG to 0 and changed the get unread to check for Null or 0. What should be done then for the future is to modify the default flag column value should be 0 and remove the check for "is null" in the read column. As I mentioned, my current changes are in CVS and will be in 0.3. Thanks again to Miles for pointing out this bug. Guess no one else has recently tried to "mark as unread" :) Andrew On 4/7/06, Kevin <ke...@dr...> wrote: > > > Well, by default, the column values are NULL, so when the "view > > unread" gets all the NULL, then that's ok. However, the > > fof_update_item_flag takes FOF_UNREAD_FLAG, which was NULL (I changed > > it in init.php to 0). > > > > With NULL, and the SQL query via ADODB sets the flag to 0 (at least in > > my testing), which then doesn't have it show up when the get_items() > > looks for all items with flag =3D NULL. > > > > So, ADODB on MySQL appears to set NULL as 0. > > I believe ADODB is doing the right thing. We defined the FOF_UNREAD_FLAG > as the string 'NULL', instead of using a real null data type. ADODB see= s > the parameter is a string and escapes and quotes before sending the query > to the database. The database sees the string value 'NULL', which is an > invalid integer, and defaults to use the integer value 0. > > If the FOF_UNREAD_FLAG constant was changed so it's value was a real null= , > not a string, it should fix the reported problem. > > That said, I think it's a good design decision to switch the unread > indicator from NULL to 0. In SQL, NULL is special case indicating the > absense of any value. We are using it to indicate a value of "unread", > which is incorrect. > > > -- > Kevin > > -- Andrew Turner ajt...@hi... 42.4266N x 83.4931W http://highearthorbit.com Northville, Michigan, USA |