X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/24d7164ce1fd20686e5091d6446b3408a1c71c73..87d94e5fa2a28dac9f26632cc25a29fe088cb1e2:/writer.plp diff --git a/writer.plp b/writer.plp index 11754e8..288891a 100644 --- a/writer.plp +++ b/writer.plp @@ -127,7 +127,7 @@ if ($find) { if (exists $get{copy}) { $row = {%{$row}{ qw(lang cat) }}; } -elsif ($ENV{REQUEST_METHOD} eq 'POST') { +elsif ($ENV{REQUEST_METHOD} eq 'POST') {{ my $replace = $row; $row = {%post{ pairkeys @wordcols }}; $_ = length ? $_ : undef for values %{$row}; @@ -137,7 +137,10 @@ elsif ($ENV{REQUEST_METHOD} eq 'POST') { my $query = $find ? $db->update(word => $row, $find, \%res) : $db->insert(word => $row, \%res); $row = $query->hash; - } or Alert("Entry could not be saved", $@); + } or do { + Alert("Entry could not be saved", $@); + next; + }; my $imgpath = "data/word/org/$row->{id}.jpg"; if (($row->{source} // '') ne ($replace->{source} // '')) { @@ -182,7 +185,7 @@ elsif ($ENV{REQUEST_METHOD} eq 'POST') { unlink $thumbpath; } } -} +}} else { $row->{$_} = $get{$_} for keys %get; }