git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
24d7164
)
word edit: recover form after save error
author
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 25 May 2020 03:22:47 +0000
(
05:22
+0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 6 Jun 2020 01:49:20 +0000
(
03:49
+0200)
writer.plp
patch
|
blob
|
history
diff --git
a/writer.plp
b/writer.plp
index 11754e8a72d4b1834aa904126ad158cda5fee5f4..288891a5030688489ae47bcff3c1a7347f0d0411 100644
(file)
--- a/
writer.plp
+++ b/
writer.plp
@@
-127,7
+127,7
@@
if ($find) {
if (exists $get{copy}) {
$row = {%{$row}{ qw(lang cat) }};
}
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};
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;
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} // '')) {
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;
}
}
unlink $thumbpath;
}
}
-}
+}
}
else {
$row->{$_} = $get{$_} for keys %get;
}
else {
$row->{$_} = $get{$_} for keys %get;
}