From e0b0bc5dc88125d50186b9c0bb032bb57d14804b Mon Sep 17 00:00:00 2001 From: psdigital Date: Tue, 8 Sep 2020 09:13:14 +1200 Subject: [PATCH 1/2] Add table name to join query --- src/SearchPageController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SearchPageController.php b/src/SearchPageController.php index 71afb00..e1ac8b9 100755 --- a/src/SearchPageController.php +++ b/src/SearchPageController.php @@ -427,6 +427,7 @@ public function PerformSearch(){ $filter_join = $filter['JoinTables'][$type['Key']]; $joins.= "LEFT JOIN \"".$filter_join['Table']."\" ON \"".$type['Table']."\".\"ID\" = \"".$filter_join['Column']."\""; + $joins.= "LEFT JOIN \"".$filter_join['Table']."\" ON \"".$type['Table']."\".\"ID\" = \"".$filter_join['Table']."\".\"".$filter_join['Column']."\""; if (is_array($filter['Value'])){ $ids = ''; @@ -440,6 +441,9 @@ public function PerformSearch(){ $ids = $filter['Value']; } + if ($relations_sql !== ''){ + $relations_sql.= " AND "; + } $relations_sql.= "\"".$filter_join['Table']."\".\"".$filter['Table']."ID\" IN (". $ids .")"; } From 96f134abd447a75083a52e11111b207a87b80fc4 Mon Sep 17 00:00:00 2001 From: psdigital Date: Tue, 8 Sep 2020 09:19:32 +1200 Subject: [PATCH 2/2] Update naming of package --- composer.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 4cf5edc..09e3cd7 100755 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { - "name": "jaedb/search", + "name": "plasticstudio/search", "type": "silverstripe-vendormodule", "description": "SilverStripe search engine", - "homepage": "http://jamesbarnsley.co.nz", + "homepage": "https://psdigital.co.nz", "keywords": ["silverstripe"], "license": "BSD-3-Clause", "authors": [ @@ -13,7 +13,7 @@ } ], "support": { - "issues": "http://github.com/jaedb/search/issues" + "issues": "http://github.com/plasticstudio/search/issues" }, "extra": { "expose": [ diff --git a/package.json b/package.json index a3647d9..231671f 100755 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.1.0", "author": "James Barnsley", "description": "SilverStripe Search Engine", - "repository": "https://github.com/jaedb/search", + "repository": "https://github.com/plasticstudio/search", "licenses": { "type": "Apache License", "url": "http://www.apache.org/licenses/LICENSE-2.0.txt"