Skip to content

Commit 794920c

Browse files
authored
Merge pull request #84 from cableman/hotfix/subject_links
SUPPORT-1236: Fixed subject links in search results
2 parents 5f6e9d6 + f4d359c commit 794920c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

modules/loop_search_node/js/loopSearchBoxController.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,20 @@ angular.module('searchBoxApp').controller('loopSearchBoxController', ['CONFIG',
240240
function filterUpdated(data) {
241241
$scope.query.text = '';
242242

243-
delete $scope.query.filters['taxonomy'][data['filter']];
243+
// Ensure that data structure exists in the search query before accessing
244+
// it.
245+
if (!$scope.query.hasOwnProperty('filters')) {
246+
$scope.query.filters = {
247+
'taxonomy': {}
248+
}
249+
}
250+
if (!$scope.query.filters.hasOwnProperty('taxonomy')) {
251+
$scope.query.filter.taxonomy = { }
252+
}
253+
254+
if ($scope.query.filters.taxonomy.hasOwnProperty(data['filter'])) {
255+
delete $scope.query.filters['taxonomy'][data['filter']];
256+
}
244257
$scope.query.filters['taxonomy'][data['filter']] = {};
245258
$scope.query.filters['taxonomy'][data['filter']][data['selection']] = true;
246259

0 commit comments

Comments
 (0)