mirror of
https://github.com/grocy/grocy.git
synced 2025-08-21 04:43:32 +00:00
Fixed OFF barcode lookup plugin API URL (fixes #2653)
This commit is contained in:
57
changelog/78_UNRELEASED_xxxx-xx-xx.md
Normal file
57
changelog/78_UNRELEASED_xxxx-xx-xx.md
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
> ⚠️ xxxBREAKING CHANGESxxx
|
||||||
|
|
||||||
|
> ❗ xxxImportant upgrade informationXXX
|
||||||
|
|
||||||
|
> 💡 xxxMinor upgrade informationXXX
|
||||||
|
|
||||||
|
### New Feature: xxxx
|
||||||
|
|
||||||
|
- Fixed that the built-in Open Food Facts external barcode lookup plugin used the staging environment of the Open Food Facts API instead of the production one
|
||||||
|
|
||||||
|
### Stock
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Shopping list
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Recipes
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Meal plan
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Chores
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Calendar
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Tasks
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Batteries
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Equipment
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Userfields
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### General
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### API
|
||||||
|
|
||||||
|
- xxx
|
@@ -15,7 +15,7 @@ class OpenFoodFactsBarcodeLookupPlugin extends BaseBarcodeLookupPlugin
|
|||||||
protected function ExecuteLookup($barcode)
|
protected function ExecuteLookup($barcode)
|
||||||
{
|
{
|
||||||
$webClient = new Client(['http_errors' => false]);
|
$webClient = new Client(['http_errors' => false]);
|
||||||
$response = $webClient->request('GET', 'https://world.openfoodfacts.net/api/v2/product/' . preg_replace('/[^0-9]/', '', $barcode) . '?fields=product_name,image_url', ['headers' => ['User-Agent' => 'GrocyOpenFoodFactsBarcodeLookupPlugin/1.0 (https://grocy.info)']]);
|
$response = $webClient->request('GET', 'https://world.openfoodfacts.org/api/v2/product/' . preg_replace('/[^0-9]/', '', $barcode) . '?fields=product_name,image_url', ['headers' => ['User-Agent' => 'GrocyOpenFoodFactsBarcodeLookupPlugin/1.0 (https://grocy.info)']]);
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
|
|
||||||
// Guzzle throws exceptions for connection errors, so nothing to do on that here
|
// Guzzle throws exceptions for connection errors, so nothing to do on that here
|
||||||
|
Reference in New Issue
Block a user