Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: URL linked to $request_ref->{world_current_link} & $world_subdomain #6661

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ init_backend: build_lang
create_mongodb_indexes:
@echo "🥫 Creating MongoDB indexes …"
docker cp conf/mongodb/create_indexes.js $(shell docker-compose ps -q mongodb):/data/db
${DOCKER_COMPOSE} exec -T mongodb /bin/sh -c "mongo off /data/db/create_indexes.js"
${DOCKER_COMPOSE} exec -T mongodb '/bin/sh' -c "mongo off /data/db/create_indexes.js"

refresh_product_tags:
@echo "🥫 Refreshing products tags (update MongoDB products_tags collection) …"
# get id for mongodb container
docker cp scripts/refresh_products_tags.js $(shell docker-compose ps -q mongodb):/data/db
${DOCKER_COMPOSE} exec -T mongodb /bin/sh -c "mongo off /data/db/refresh_products_tags.js"
${DOCKER_COMPOSE} exec -T mongodb '/bin/sh' -c "mongo off /data/db/refresh_products_tags.js"

import_sample_data:
@echo "🥫 Importing sample data (~200 products) into MongoDB …"
Expand All @@ -160,7 +160,7 @@ import_prod_data:
@echo "🥫 Copying the dump to MongoDB container …"
docker cp openfoodfacts-mongodbdump.tar.gz $(shell docker-compose ps -q mongodb):/data/db
@echo "🥫 Restoring the MongoDB dump …"
${DOCKER_COMPOSE} exec -T mongodb /bin/sh -c "cd /data/db && tar -xzvf openfoodfacts-mongodbdump.tar.gz && mongorestore --batchSize=1 && rm openfoodfacts-mongodbdump.tar.gz"
${DOCKER_COMPOSE} exec -T mongodb '/bin/sh' -c "cd /data/db && tar -xzvf openfoodfacts-mongodbdump.tar.gz && mongorestore --batchSize=1 && rm openfoodfacts-mongodbdump.tar.gz"
rm openfoodfacts-mongodbdump.tar.gz

#--------#
Expand Down
22 changes: 22 additions & 0 deletions docs/introduction/dev-environment-quick-start-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,25 @@ You need to remove current directory where you clone the project, and clone the

```console
git clone -c core.symlinks=true git@github.com:openfoodfacts/openfoodfacts-server.git

```console
git clone -c core.symlinks=true git@github.com:openfoodfacts/openfoodfacts-server.git


### make dev error: [create_mongodb_indexes] Error 126 - C:/Program Files/Git/usr/bin/sh: no such file or directory: unknown

When running "make dev":

```console
🥫 Creating MongoDB indexes …
docker cp conf/mongodb/create_indexes.js 1aabb19cd6ad30ecf50ef24b7bc5f5e9fe60e69b218ea0db8273f4e8ec01a1aa:/data/db
docker-compose --env-file=.env exec -T mongodb /bin/sh -c "mongo off /data/db/create_indexes.js"
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "C:/Program Files/Git/usr/bin/sh": stat C:/Program Files/Git/usr/bin/sh: no such file or directory: unknown
make: *** [create_mongodb_indexes] Error 126
```

Solution:
Go to openfoodfacts-server and open the Makefile.
Search for '/bin/sh', and replace it with '//bin/sh' - double the slashes. (There will be three /bin/sh, replace all three)
Save the Makefile and again run "make dev".

10 changes: 5 additions & 5 deletions lib/ProductOpener/Display.pm
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ use vars qw();

$static_subdomain = format_subdomain('static');
$images_subdomain = format_subdomain('images');
$world_subdomain = format_subdomain('world');
$world_subdomain = format_subdomain("world-" . $lc);

my $user_preferences; # enables using user preferences to show a product summary and to rank and filter results

Expand Down Expand Up @@ -2965,7 +2965,7 @@ sub display_points($) {
}
$newtagidpath = canonicalize_taxonomy_tag_link($lc,$tagtype, $newtagid);
$request_ref->{current_link} = $newtagidpath;
$request_ref->{world_current_link} = canonicalize_taxonomy_tag_link('en',$tagtype, $canon_tagid);
$request_ref->{world_current_link} = canonicalize_taxonomy_tag_link($lc,$tagtype, $canon_tagid);
}
else {
$display_tag = canonicalize_tag2($tagtype, $tagid);
Expand Down Expand Up @@ -3140,7 +3140,7 @@ sub display_tag($) {
}
$newtagidpath = canonicalize_taxonomy_tag_link($lc,$tagtype, $newtagid);
$request_ref->{current_link} = $newtagidpath;
$request_ref->{world_current_link} = canonicalize_taxonomy_tag_link('en',$tagtype, $canon_tagid);
$request_ref->{world_current_link} = canonicalize_taxonomy_tag_link($lc,$tagtype, $canon_tagid);
}
else {
$display_tag = canonicalize_tag2($tagtype, $tagid);
Expand Down Expand Up @@ -3189,7 +3189,7 @@ sub display_tag($) {
}
$newtagid2path = canonicalize_taxonomy_tag_link($lc,$tagtype2, $newtagid2);
$request_ref->{current_link} .= $newtagid2path;
$request_ref->{world_current_link} .= canonicalize_taxonomy_tag_link('en',$tagtype2, $canon_tagid2);
$request_ref->{world_current_link} .= canonicalize_taxonomy_tag_link($lc,$tagtype2, $canon_tagid2);
}
else {
$display_tag2 = canonicalize_tag2($tagtype2, $tagid2);
Expand Down Expand Up @@ -3223,7 +3223,7 @@ sub display_tag($) {
}

if (defined $request_ref->{groupby_tagtype}) {
$request_ref->{world_current_link} .= "/" . $tag_type_plural{$request_ref->{groupby_tagtype}}{en};
$request_ref->{world_current_link} .= "/" . $tag_type_plural{$request_ref->{groupby_tagtype}}{$lc};
}

if (((defined $newtagid) and ($newtagid ne $tagid)) or ((defined $newtagid2) and ($newtagid2 ne $tagid2))) {
Expand Down
2 changes: 1 addition & 1 deletion po/common/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -5390,7 +5390,7 @@ msgstr "Score environnemental PEF"

msgctxt "ecoscore_incl_climate_change_impact"
msgid "including impact on climate change"
msgstr "dont impact sur le changement climatique :"
msgstr "dont impact sur le changement climatique"

msgctxt "ecoscore_impact_detail_by_stages"
msgid "Details of the impacts by stages of the life cycle"
Expand Down