Skip to content

Commit

Permalink
Merge pull request #93 from EmicoEcommerce/bugfix-guzzle-error-autoco…
Browse files Browse the repository at this point in the history
…mplete

Bugfix guzzle library
  • Loading branch information
dz-optimizers authored Sep 6, 2023
2 parents 643f2f0 + cd079f8 commit d46606e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Model/Autocomplete/DataProvider/SuggestionDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Tweakwise\Magento2Tweakwise\Model\Client\Response\AutocompleteProductResponseInterface;
use Tweakwise\Magento2Tweakwise\Model\Client\Response\Suggestions\SuggestionsResponse;
use Tweakwise\Magento2Tweakwise\Model\Config;
use function GuzzleHttp\Promise\unwrap;
use GuzzleHttp\Promise\Utils;
use Magento\Framework\Exception\LocalizedException;
use Magento\Search\Model\Autocomplete\ItemInterface;

Expand Down Expand Up @@ -146,7 +146,7 @@ public function getItems()
}

$results = [];
$responses = unwrap($promises);
$responses = Utils::unwrap($promises);
foreach ($responses as $key => $response) {
if ($response instanceof AutocompleteProductResponseInterface) {
$results[] = $this->dataProviderHelper->getProductItems($response);
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"ext-simplexml": "*",
"ext-libxml": "*",
"tweakwise/magento2-tweakwise-export": ">=4.0",
"guzzlehttp/guzzle": ">=6.0"
"guzzlehttp/guzzle": ">=6.0",
"guzzlehttp/promises": ">=1.4"
},
"type": "magento2-module",
"autoload": {
Expand Down

0 comments on commit d46606e

Please sign in to comment.