From: Will Budic Date: Wed, 19 Feb 2020 10:31:34 +0000 (+1100) Subject: toLog fixes! X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=c28ccfad0155c69c004a3c5c0117f1ffcfc78bb3;p=LifeLog.git toLog fixes! --- diff --git a/Current Development Check List.md b/Current Development Check List.md index f5e4649..16fabde 100644 --- a/Current Development Check List.md +++ b/Current Development Check List.md @@ -78,7 +78,7 @@ This version is not compatible in data structure to prior versions. Data migrati ### v. 1.8 Encountered/Fixed -* Bug 18 - Same day datediff is displaying wrong report in time stack on the page. +* Bug 19 - Same day datediff is displaying wrong report in time stack on the page. * ✔ Issue 18 - Setting excludes for views, deliveres page but long delays with server finished exchange (page doesn't hang). * The page is server delivered, if sections contain external internet links, this timeouts page browser delivery if the internet is down. * ✔ Bug 17 - Editing of entries on occasions, duplicates entries. diff --git a/htdocs/cgi-bin/system/modules/Settings.pm b/htdocs/cgi-bin/system/modules/Settings.pm index b9b2128..6f82267 100644 --- a/htdocs/cgi-bin/system/modules/Settings.pm +++ b/htdocs/cgi-bin/system/modules/Settings.pm @@ -247,10 +247,15 @@ sub toLog { my $stamp = getCurrentSQLTimeStamp(); if(!$cat){ my @arr = selectRecords($db,"SELECT ID FROM CAT WHERE NAME LIKE 'System';")->fetchrow_array(); - $cat = 0 if not @arr; + if(@arr){ + $cat = $arr[0]; + } + else{ + $cat = 6; + } } $log =~ s/'/''/g; - $db->do("INSERT INTO LOG (ID_CAT, DATE, LOG) VALUES(6,'$stamp', \"$log\");"); + $db->do("INSERT INTO LOG (ID_CAT, DATE, LOG) VALUES($cat,'$stamp', \"$log\");"); } sub countRecordsIn {