diff --git a/fhem/CHANGED b/fhem/CHANGED index b87d518d0..4043972ba 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 93_DbRep: importFromFile format problem if UNIT-field wasn't set - feature: 98_fhemdebug, to aid "Error: >< no TYPE" debugging. - feature: 70_Jabber Added possibility to change componentname via attr JabberDomain diff --git a/fhem/FHEM/93_DbRep.pm b/fhem/FHEM/93_DbRep.pm index a9d545231..b81012f3d 100644 --- a/fhem/FHEM/93_DbRep.pm +++ b/fhem/FHEM/93_DbRep.pm @@ -40,6 +40,7 @@ ########################################################################################################### # Versions History: # +# 4.10.1 30.11.2016 bugfix importFromFile format problem if UNIT-field wasn't set # 4.10 28.12.2016 del_DoParse changed to use Wildcards, del_ParseDone changed to use readingNameMap # 4.9 23.12.2016 function readingRename added # 4.8.6 17.12.2016 new bugfix group by-clause due to incompatible changes made in MyQL 5.7.5 @@ -168,7 +169,7 @@ use Blocking; use Time::Local; # no if $] >= 5.017011, warnings => 'experimental'; -my $DbRepVersion = "4.10"; +my $DbRepVersion = "4.10.1"; my %dbrep_col = ("DEVICE" => 64, "TYPE" => 64, @@ -2383,9 +2384,9 @@ sub del_ParseDone($) { } my $reading = AttrVal($hash->{NAME}, "reading", undef); - $reading =~ s/%/\//g; + $reading =~ s/%/\//g if ($reading); my $device = AttrVal($hash->{NAME}, "device", undef); - $device =~ s/%/\//g; + $device =~ s/%/\//g if ($device); # only for this block because of warnings if details of readings are not set no warnings 'uninitialized'; @@ -3043,15 +3044,17 @@ sub impfile_Push($) { $al = $_; chomp $al; my @alarr = split("\",\"", $al); + foreach(@alarr) { + tr/"//d; + } my $i_timestamp = $alarr[0]; - $i_timestamp =~ tr/"//d; + # $i_timestamp =~ tr/"//d; my $i_device = $alarr[1]; my $i_type = $alarr[2]; my $i_event = $alarr[3]; my $i_reading = $alarr[4]; my $i_value = $alarr[5]; my $i_unit = $alarr[6] ? $alarr[6]: " "; - $i_unit =~ tr/"//d; $irowcount++; next if(!$i_timestamp); #leerer Datensatz @@ -3059,7 +3062,7 @@ sub impfile_Push($) { my ($i_date, $i_time) = split(" ",$i_timestamp); if ($i_date !~ /(\d{4})-(\d{2})-(\d{2})/ || $i_time !~ /(\d{2}):(\d{2}):(\d{2})/) { $err = encode_base64("Format of date/time is not valid in row $irowcount of $infile. Must be format \"YYYY-MM-DD HH:MM:SS\" !",""); - Log3 ($name, 2, "DbRep $name -> ERROR - Import of datasets of file $infile was NOT done. Invalid date/time field format in row $irowcount !"); + Log3 ($name, 2, "DbRep $name -> ERROR - Import from file $infile was not done. Invalid date/time field format in row $irowcount."); close(FH); $dbh->rollback; Log3 ($name, 4, "DbRep $name -> BlockingCall impfile_Push finished"); @@ -3842,8 +3845,8 @@ return;