Fix Search.pm for WebGUI::Definition and exceptions.
This commit is contained in:
parent
929d867373
commit
e873f5e653
1 changed files with 3 additions and 3 deletions
|
|
@ -117,13 +117,13 @@ Returns an array reference containing asset objects for those that matched.
|
|||
|
||||
sub getAssets {
|
||||
my $self = shift;
|
||||
my $query = $self->_getQuery([qw(assetIndex.assetId assetIndex.className assetIndex.revisionDate)]);
|
||||
my $query = $self->_getQuery([qw(assetIndex.assetId assetIndex.revisionDate)]);
|
||||
my $rs = $self->session->db->prepare($query);
|
||||
$rs->execute($self->{_params});
|
||||
my @assets = ();
|
||||
while (my ($id, $class, $version) = $rs->array) {
|
||||
my $asset = WebGUI::Asset->new($self->session, $id, $class, $version);
|
||||
unless (defined $asset) {
|
||||
my $asset = eval { WebGUI::Asset->newById($self->session, $id, $version); };
|
||||
if (Exception::Class->caught()) {
|
||||
$self->session->errorHandler->warn("Search index contains assetId $id even though it no longer exists.");
|
||||
next;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue