Skip to content

Commit

Permalink
Merge pull request #490 from jjrom/develop
Browse files Browse the repository at this point in the history
[IMPORTANT] Correct  empty "all items" in catalogs with collections
  • Loading branch information
jjrom authored Jan 31, 2025
2 parents 2de785e + b476427 commit 0e56e9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/resto/core/RestoConstants.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class RestoConstants
// [IMPORTANT] Starting resto 7.x, default routes are defined in RestoRouter class

// resto version
const VERSION = '9.5.9';
const VERSION = '9.6.0';

/* ============================================================
* NEVER EVER TOUCH THESE VALUES
Expand Down
7 changes: 4 additions & 3 deletions app/resto/core/dbfunctions/FiltersFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function prepareFilters($paramsWithOperation, $sortKey)
if (isset($filterCS) && $filterCS !== '') {
$filters[] = $filterCS;
}

/*
* Skip the following
*/
Expand Down Expand Up @@ -155,7 +155,7 @@ public function prepareFilters($paramsWithOperation, $sortKey)
}
}
}

// searchTerms specialcase - everything processed at the end
if (count($this->terms) > 0) {

Expand Down Expand Up @@ -947,7 +947,8 @@ private function getCollectionsInCatalog($catalogPartName)
$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) . '%\'');
while ($result = pg_fetch_assoc($results)) {
if ($result['rtype'] === 'collection') {
$collectionId = str_replace('collections/', '', $result['id']);
// The collection name is the last string of path
$collectionId = end(explode('/', $result['id']));
if ( !in_array($collectionId, $collectionIds) ) {
$collectionIds[] = $collectionId;
}
Expand Down

0 comments on commit 0e56e9d

Please sign in to comment.