From f0c0c4042d7c9a95689f6bc93b088ad6b9c01586 Mon Sep 17 00:00:00 2001 From: Yung Han Khoe Date: Wed, 26 Nov 2008 17:39:46 +0000 Subject: [PATCH] Fixed some Matrix bugs --- lib/WebGUI/Asset/Wobject/Matrix.pm | 31 ++++++++++++++----------- lib/WebGUI/i18n/English/Asset_Matrix.pm | 2 +- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Matrix.pm b/lib/WebGUI/Asset/Wobject/Matrix.pm index 4248992f3..da641c354 100644 --- a/lib/WebGUI/Asset/Wobject/Matrix.pm +++ b/lib/WebGUI/Asset/Wobject/Matrix.pm @@ -455,10 +455,12 @@ sub view { limit => 1, returnObjects => 1, }) }; - $var->{bestViews_url} = $bestViews_listing->getUrl; - $var->{bestViews_count} = $bestViews_listing->get('views'); - $var->{bestViews_name} = $bestViews_listing->get('title'); - $var->{bestViews_sortButton} = "
"; + if($bestViews_listing){ + $var->{bestViews_url} = $bestViews_listing->getUrl; + $var->{bestViews_count} = $bestViews_listing->get('views'); + $var->{bestViews_name} = $bestViews_listing->get('title'); + $var->{bestViews_sortButton} = "
"; + } # Get the MatrixListing with the most compares as an object using getLineage. @@ -469,10 +471,12 @@ sub view { limit => 1, returnObjects => 1, }) }; - $var->{bestCompares_url} = $bestCompares_listing->getUrl; - $var->{bestCompares_count} = $bestCompares_listing->get('compares'); - $var->{bestCompares_name} = $bestCompares_listing->get('title'); - $var->{bestCompares_sortButton} = "
"; + if($bestCompares_listing){ + $var->{bestCompares_url} = $bestCompares_listing->getUrl; + $var->{bestCompares_count} = $bestCompares_listing->get('compares'); + $var->{bestCompares_name} = $bestCompares_listing->get('title'); + $var->{bestCompares_sortButton} = "
"; + } # Get the MatrixListing with the most clicks as an object using getLineage. my ($bestClicks_listing) = @{ $self->getLineage(['descendants'], { @@ -482,11 +486,12 @@ sub view { limit => 1, returnObjects => 1, }) }; - $var->{bestClicks_url} = $bestClicks_listing->getUrl; - $var->{bestClicks_count} = $bestClicks_listing->get('clicks'); - $var->{bestClicks_name} = $bestClicks_listing->get('title'); - $var->{bestClicks_sortButton} = "
"; - + if($bestClicks_listing){ + $var->{bestClicks_url} = $bestClicks_listing->getUrl; + $var->{bestClicks_count} = $bestClicks_listing->get('clicks'); + $var->{bestClicks_name} = $bestClicks_listing->get('title'); + $var->{bestClicks_sortButton} = "
"; + } # Get the 5 MatrixListings that were last updated as objects using getLineage. my @lastUpdatedListings = @{ $self->getLineage(['descendants'], { diff --git a/lib/WebGUI/i18n/English/Asset_Matrix.pm b/lib/WebGUI/i18n/English/Asset_Matrix.pm index 5062b2d8b..bee03b53c 100644 --- a/lib/WebGUI/i18n/English/Asset_Matrix.pm +++ b/lib/WebGUI/i18n/English/Asset_Matrix.pm @@ -511,7 +511,7 @@ listing,|, }, 'categories default value' => { - message => q|Features\nBenefits|, + message => qq|Features\nBenefits|, lastUpdated => 0, },