fixed: fatal error duplicate keywords added to a wiki page
This commit is contained in:
parent
abf9f93dd7
commit
d49b7a7077
2 changed files with 6 additions and 3 deletions
|
|
@ -6,6 +6,7 @@
|
||||||
- fixed: changing image thumbnail size doesn't resize image
|
- fixed: changing image thumbnail size doesn't resize image
|
||||||
- fixed: loadAddConfigs loads hidden files
|
- fixed: loadAddConfigs loads hidden files
|
||||||
- ensure proper XML encoding for ITransact messages
|
- ensure proper XML encoding for ITransact messages
|
||||||
|
- fixed: fatal error duplicate keywords added to a wiki page
|
||||||
|
|
||||||
7.5.5
|
7.5.5
|
||||||
- fixed: Several typos in the new Calendar help documentation.
|
- fixed: Several typos in the new Calendar help documentation.
|
||||||
|
|
|
||||||
|
|
@ -268,18 +268,20 @@ sub setKeywordsForAsset {
|
||||||
else {
|
else {
|
||||||
@{$keywords} = split(" ", $options->{keywords});
|
@{$keywords} = split(" ", $options->{keywords});
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->deleteKeywordsForAsset($options->{asset});
|
$self->deleteKeywordsForAsset($options->{asset});
|
||||||
my $assetId = $options->{asset}->getId;
|
my $assetId = $options->{asset}->getId;
|
||||||
if (scalar(@{$keywords})) {
|
if (scalar(@{$keywords})) {
|
||||||
my $sth = $self->session->db->prepare("insert into assetKeyword (assetId, keyword) values (?,?)");
|
my $sth = $self->session->db->prepare("insert into assetKeyword (assetId, keyword) values (?,?)");
|
||||||
|
my %found_keywords;
|
||||||
foreach my $keyword (@{$keywords}) {
|
foreach my $keyword (@{$keywords}) {
|
||||||
next if ($keyword eq "");
|
next if ($keyword eq "");
|
||||||
|
next
|
||||||
|
if $found_keywords{$keyword};
|
||||||
|
$found_keywords{$keyword}++;
|
||||||
$sth->execute([$assetId, lc($keyword)]);
|
$sth->execute([$assetId, lc($keyword)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$self->deleteKeywordsForAsset($options->{asset});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue