summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomasdbcklr2018-11-24 09:55:38 (GMT)
committerJoris Vercammen2018-11-24 09:55:38 (GMT)
commit226e6d4d0951f5c98f3c648747550a4681ab4a96 (patch)
tree03a065dc83c924644c3974473b192f1a678595e4
parent990a51d1c0c60d4ec7344bfdd18a76571fbd27c5 (diff)
Issue #3000495 by nikunj.addweb, Kunal.Udani, Thomasdbcklr: Update to Facets 8.x-1.1: Error: Call to a member function getResultCount()
-rw-r--r--src/Plugin/facets/facet_source/SearchApiDisplay.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Plugin/facets/facet_source/SearchApiDisplay.php b/src/Plugin/facets/facet_source/SearchApiDisplay.php
index 5f3c7f4..7ae0529 100644
--- a/src/Plugin/facets/facet_source/SearchApiDisplay.php
+++ b/src/Plugin/facets/facet_source/SearchApiDisplay.php
@@ -405,7 +405,12 @@ class SearchApiDisplay extends FacetSourcePluginBase implements SearchApiFacetSo
*/
public function getCount() {
$search_id = $this->getDisplay()->getPluginId();
- return $this->searchApiQueryHelper->getResults($search_id)->getResultCount();
+ if ($search_id && !empty($search_id)) {
+ if ($this->searchApiQueryHelper->getResults($search_id) !== NULL) {
+ return $this->searchApiQueryHelper->getResults($search_id)
+ ->getResultCount();
+ }
+ }
}
}