Patch do bledu w LMS-MGC - nieprawidlowe pobieranie predkosci z bazy
Witajcie, Pisalem niedawno o bledzie, wreszcie udalo mi sie znalezc troche czasu i go wytropilem :) W momencie kiedy uzytkownik ma datefrom, a nie ma dateto, to nie wyciaga predkosci z bazy, wiec predkosc jest null. A oto patch do aktualnej wersji: ## start ########################################### *** lms-mgc 2004-05-10 13:38:37.000000000 +0200 --- lms-mgc-new 2004-07-13 19:55:13.000000000 +0200 *************** sub instance($) *** 411,417 **** my %uprates; my %downrates; ! $dbq = $dbase->prepare("SELECT userid, SUM(uprate) AS uprate, SUM(downrate) AS downrate FROM assignments, users, tariffs WHERE users.id = userid AND deleted = 0 AND tariffid = tariffs.id AND (datefrom <= $utsfmt OR datefrom = 0) AND (dateto > $utsfmt OR dateto = 0) AND (datefrom <= dateto) GROUP BY userid"); $dbq->execute(); while(my $row = $dbq->fetchrow_hashref()) --- 411,417 ---- my %uprates; my %downrates; ! $dbq = $dbase->prepare("SELECT userid, SUM(uprate) AS uprate, SUM(downrate) AS downrate FROM assignments, users, tariffs WHERE users.id = userid AND deleted = 0 AND tariffid = tariffs.id AND (datefrom <= $utsfmt OR datefrom = 0) AND (dateto > $utsfmt OR dateto = 0) AND (datefrom <= dateto OR dateto = 0) GROUP BY userid"); $dbq->execute(); while(my $row = $dbq->fetchrow_hashref()) ## end ############################################ pozdrawiam -- Best regards, Przemek mailto:sako@infinity.waw.pl
uczestnicy (1)
-
Przemek SAKO Galczewski