Skip to content

Commit

Permalink
feat: new import_images.pl script
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanegigandet committed Jan 10, 2025
1 parent a35d15a commit c7324f8
Show file tree
Hide file tree
Showing 10 changed files with 569 additions and 272 deletions.
2 changes: 1 addition & 1 deletion cgi/product_image_move.pl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
exit(0);
}

my $product_ref = product_exists($product_id); # returns 0 if not
my $product_ref = retrieve_product($product_id);

if (not $product_ref) {
$log->warn("product does not exist", {code => $code, product_id => $product_id});
Expand Down
2 changes: 1 addition & 1 deletion cgi/product_image_upload.pl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
exit(0);
}

my $product_ref = product_exists($product_id); # returns 0 if not
my $product_ref = retrieve_product($product_id);

if (not $product_ref) {
$log->info("product code does not exist yet, creating product", {code => $code});
Expand Down
2 changes: 1 addition & 1 deletion cgi/product_multilingual.pl
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ ($product_ref)
$product_id = product_id_for_owner($Owner_id, $code);
$log->debug("we have a code", {code => $code, product_id => $product_id}) if $log->is_debug();

$product_ref = product_exists($product_id); # returns 0 if not
$product_ref = retrieve_product($product_id);

if ($product_ref) {
$log->info("product exists, redirecting to page", {code => $code}) if $log->is_info();
Expand Down
4 changes: 2 additions & 2 deletions cgi/search.pl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
use ProductOpener::Display qw/:all/;
use ProductOpener::HTTP qw/write_cors_headers/;
use ProductOpener::Users qw/$Owner_id/;
use ProductOpener::Products qw/normalize_code normalize_search_terms product_exists product_id_for_owner product_url/;
use ProductOpener::Products qw/normalize_code normalize_search_terms retrieve_product product_id_for_owner product_url/;
use ProductOpener::Food qw/%nutriments_lists/;
use ProductOpener::Tags qw/:all/;
use ProductOpener::PackagerCodes qw/normalize_packager_codes/;
Expand Down Expand Up @@ -166,7 +166,7 @@
if ((defined $code) and (length($code) > 0)) {
my $product_id = product_id_for_owner($Owner_id, $code);

my $product_ref = product_exists($product_id); # returns 0 if not
my $product_ref = retrieve_product($product_id);

if ($product_ref) {
$log->info("product code exists, redirecting to product page", {code => $code});
Expand Down
Loading

0 comments on commit c7324f8

Please sign in to comment.