diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index c3c09d05d..9d6b1f29c 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -25,6 +25,7 @@ perlmonkey2) - fixed: Thing list drop down broken when multiple thingy's on one page. - fixed: Shop Tax pagination and sorting now work. + - fixed: Keywords and SKU assets 7.5.16 - Created a migration from 7.4.40 directly to 7.5.16. diff --git a/lib/WebGUI/Keyword.pm b/lib/WebGUI/Keyword.pm index b37cea246..4737f646d 100644 --- a/lib/WebGUI/Keyword.pm +++ b/lib/WebGUI/Keyword.pm @@ -183,6 +183,7 @@ An array reference of keywords to match. =head3 matchAssetKeywords A reference to an asset that has a list of keywords to match. This can help locate assets that are similar to another asset. +If the referenced asset does not have any keywords, then an empty array reference is returned. =head3 isa @@ -213,6 +214,7 @@ sub getMatchingAssets { asset => $options->{matchAssetKeywords}, asArrayRef => 1, }); + return [] unless scalar @{ $options->{keywords} }; } # looking for a class name match @@ -240,7 +242,7 @@ sub getMatchingAssets { # write the query my $query = 'select distinct assetKeyword.assetId from assetKeyword left join asset using (assetId) where '.join(' and ', @clauses).' order by creationDate desc'; - + # perform the search if ($options->{usePaginator}) { my $p = WebGUI::Paginator->new($self->session);