Skip to content

Commit 9ee01ab

Browse files
committed
[STAC] Check for greater or equal to ADDON_STAC_MINMATCH (previously greater only)
1 parent 7edcd2e commit 9ee01ab

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ pgdata.old
55
app/resto/addons
66
saml/cert/server.crt
77
saml/cert/server.pem
8-
docker-compose.local.yml
9-
config-local.env
108
errors.log
119
.private
1210
.DS_Store
1311
.php-cs-fixer.cache
12+
# Local config and attached docker-compose
13+
_config*.env
14+
_docker-compose*.yml

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 = '7.0.0-rc.3';
23+
const VERSION = '7.0.0-rc.4';
2424

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

app/resto/core/addons/STAC.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ public function getChildren($params)
349349
// Initialize router to process each children individually
350350
$router = new RestoRouter($this->context, $this->user);
351351

352-
$links = $this->stacUtil->getRootCatalogLinks();
352+
$links = $this->stacUtil->getRootCatalogLinks($this->options['minMatch']);
353353
for ($i = 0, $ii = count($links); $i < $ii; $i++) {
354354
if ($links[$i]['rel'] == 'child') {
355355
try {
@@ -1018,7 +1018,7 @@ private function load($params = array())
10181018

10191019
// Root
10201020
if ($nbOfSegments === 0) {
1021-
$this->links = $this->stacUtil->getRootCatalogLinks();
1021+
$this->links = $this->stacUtil->getRootCatalogLinks($this->options['minMatch']);
10221022
}
10231023

10241024
// View special case
@@ -1279,7 +1279,7 @@ private function setCatalogsLinksFromFacet($params)
12791279
return $this->setFeatureCollection($leafValue, $params);
12801280
}
12811281
}
1282-
1282+
12831283
// Add parent link
12841284
if ($nbOfSegments > 1) {
12851285
$this->links[] = array(
@@ -1303,7 +1303,7 @@ private function setCatalogsLinksFromFacet($params)
13031303
}
13041304

13051305
$matched = (integer) $result['matched'];
1306-
if ($matched > $this->options['minMatch']) {
1306+
if ($matched >= $this->options['minMatch']) {
13071307
$link = array(
13081308
'rel' => ((integer) $result['isleaf']) === 1 ? 'items' : 'child',
13091309
'title' => $result['value'],

app/resto/core/utils/STACUtil.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct($context, $user)
6161
*
6262
* @return array
6363
*/
64-
public function getRootCatalogLinks($minMatch = 0)
64+
public function getRootCatalogLinks($minMatch)
6565
{
6666
$links = array();
6767
$facets = $this->getFacets($minMatch);
@@ -189,7 +189,7 @@ public function getFacets($minMatch)
189189
if ($result['type'] === 'collection') {
190190
$facets['count'] = $matched;
191191
} else {
192-
if ($matched > $minMatch) {
192+
if ($matched >= $minMatch) {
193193
// Catalog
194194
if ($result['type'] === 'catalog' || $result['type'] === 'hashtag') {
195195
$facets[$result['type'] . 's'] = $matched;

docker-compose.dev.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ services:
1010
- ./app/resto/core:/app/resto/core:ro
1111
- ./app/vendor:/app/vendor:ro
1212
- ./build/resto/container_root/cont-init.d/:/etc/cont-init.d/:ro
13-
- /Users/jrom/Devel/cnes-valorisation-planeto/components/catalog/addons/resto-addon-pdssp/src/MarsPDSSPModel.php:/app/resto/addons/MarsPDSSPModel.php:ro
14-
- /Users/jrom/Devel/dea-access/components/resto-dea/addons/resto-addon-dea/src/DEAModel.php:/app/resto/addons/DEAModel.php:ro
1513
restodb:
1614
volumes:
17-
- ./postgresql-conf/postgresql-dev.conf:/etc/postgresql.conf
15+
- ./postgresql-conf/postgresql-dev.conf:/var/lib/postgresql/data/postgresql.conf

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ services:
5555
interval: 1m
5656
timeout: 5s
5757
volumes:
58-
- ./postgresql-conf/postgresql.conf:/etc/postgresql.conf
58+
- ./postgresql-conf/postgresql.conf:/var/lib/postgresql/data/postgresql.conf
5959
- database_data:/var/lib/postgresql/data

0 commit comments

Comments
 (0)