Skip to content

Commit 0e56e9d

Browse files
authored
Merge pull request #490 from jjrom/develop
[IMPORTANT] Correct empty "all items" in catalogs with collections
2 parents 2de785e + b476427 commit 0e56e9d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

app/resto/core/RestoConstants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class RestoConstants
2020
// [IMPORTANT] Starting resto 7.x, default routes are defined in RestoRouter class
2121

2222
// resto version
23-
const VERSION = '9.5.9';
23+
const VERSION = '9.6.0';
2424

2525
/* ============================================================
2626
* NEVER EVER TOUCH THESE VALUES

app/resto/core/dbfunctions/FiltersFunctions.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function prepareFilters($paramsWithOperation, $sortKey)
8686
if (isset($filterCS) && $filterCS !== '') {
8787
$filters[] = $filterCS;
8888
}
89-
89+
9090
/*
9191
* Skip the following
9292
*/
@@ -155,7 +155,7 @@ public function prepareFilters($paramsWithOperation, $sortKey)
155155
}
156156
}
157157
}
158-
158+
159159
// searchTerms specialcase - everything processed at the end
160160
if (count($this->terms) > 0) {
161161

@@ -947,7 +947,8 @@ private function getCollectionsInCatalog($catalogPartName)
947947
$results = $this->context->dbDriver->query('SELECT id,rtype,counters,links FROM ' . $this->context->dbDriver->targetSchema . '.catalog WHERE id ILIKE \'%' . $this->context->dbDriver->escape_string($catalogPartName) . '%\'');
948948
while ($result = pg_fetch_assoc($results)) {
949949
if ($result['rtype'] === 'collection') {
950-
$collectionId = str_replace('collections/', '', $result['id']);
950+
// The collection name is the last string of path
951+
$collectionId = end(explode('/', $result['id']));
951952
if ( !in_array($collectionId, $collectionIds) ) {
952953
$collectionIds[] = $collectionId;
953954
}

0 commit comments

Comments
 (0)