From 4b65b441e04575f2585e390987de6368c19c0091 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 10 Dec 2009 12:57:45 -0800 Subject: [PATCH] Matrix search should be AND based, not OR. Fixes bug #11301 --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/Matrix.pm | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 7ae31bd67..be86abab5 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,7 @@ - fixed #11294: Matrix - Best/Worse Rated Calculations - fixed getIsa returns undef for pending assets - fixed #11299: Matrix - Cannot hide title + - fixed #11293: Matrix - Search not working correctly 7.8.7 - fixed #11278: Wrong test for Template::Toolkit in testEnvironment.pl diff --git a/lib/WebGUI/Asset/Wobject/Matrix.pm b/lib/WebGUI/Asset/Wobject/Matrix.pm index 4c14b0e66..fd81b0d79 100644 --- a/lib/WebGUI/Asset/Wobject/Matrix.pm +++ b/lib/WebGUI/Asset/Wobject/Matrix.pm @@ -1195,13 +1195,16 @@ sub www_getCompareFormData { where listing.matrixListingId = ? and attributeId IN(".$searchParamList.")", [$result->{assetId}],'attributeId'); + ##Searching is AND based. PARAM: foreach my $param (@searchParams_sorted) { my $fieldType = $matrixListing_attributes->{$param->{attributeId}}->{fieldType}; my $listingValue = $matrixListing_attributes->{$param->{attributeId}}->{value}; if(($fieldType eq 'MatrixCompare') && ($listingValue < $param->{value})){ + $checked = ''; last PARAM; } elsif(($fieldType ne 'MatrixCompare' && $fieldType ne '') && ($param->{value} ne $listingValue)){ + $checked = ''; last PARAM; } else{