Skip to content

Commit

Permalink
Merge pull request #1686 from algolia/release/3.13.8-dev
Browse files Browse the repository at this point in the history
Release/3.13.8 dev
  • Loading branch information
damcou authored Jan 17, 2025
2 parents adfa7e8 + 7c61852 commit 5097489
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 19 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGE LOG

## 3.13.8

### Bug Fixes
- Restored compatibility with PHP 7.4

## 3.13.7

### Features
Expand Down
11 changes: 9 additions & 2 deletions Model/Config/AutomaticPriceIndexingComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@

class AutomaticPriceIndexingComment implements CommentInterface
{
/**
* @var UrlInterface
*/
protected $urlInterface;

public function __construct(
protected UrlInterface $urlInterface
) { }
UrlInterface $urlInterface
) {
$this->urlInterface = $urlInterface;
}

public function getCommentText($elementValue)
{
Expand Down
53 changes: 45 additions & 8 deletions Plugin/AddToCartRedirectForInsights.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,51 @@ class AddToCartRedirectForInsights
*/
private $requestInfoFilter;

/**
* @var StoreManagerInterface
*/
protected $storeManager;

/**
* @var ProductRepositoryInterface
*/
protected $productRepository;

/**
* @var Session
*/
protected $checkoutSession;

/**
* @var StockRegistryInterface
*/
protected $stockRegistry;

/**
* @var ManagerInterface
*/
protected ManagerInterface $eventManager;

/**
* @var ConfigHelper
*/
protected ConfigHelper $configHelper;

public function __construct(
protected StoreManagerInterface $storeManager,
protected ProductRepositoryInterface $productRepository,
protected Session $checkoutSession,
protected StockRegistryInterface $stockRegistry,
protected ManagerInterface $eventManager,
protected ConfigHelper $configHelper,
) {}
StoreManagerInterface $storeManager,
ProductRepositoryInterface $productRepository,
Session $checkoutSession,
StockRegistryInterface $stockRegistry,
ManagerInterface $eventManager,
ConfigHelper $configHelper
) {
$this->storeManager = $storeManager;
$this->productRepository = $productRepository;
$this->checkoutSession = $checkoutSession;
$this->stockRegistry = $stockRegistry;
$this->eventManager = $eventManager;
$this->configHelper = $configHelper;
}

/**
* @param Cart $cartModel
Expand All @@ -41,7 +78,7 @@ public function __construct(
* @throws LocalizedException
* @throws NoSuchEntityException
*/
public function beforeAddProduct(Cart $cartModel, int|Product $productInfo, array|int|DataObject $requestInfo = null)
public function beforeAddProduct(Cart $cartModel, $productInfo, $requestInfo = null)
{
// First, check is Insights are enabled
if (!$this->configHelper->isClickConversionAnalyticsEnabled($this->storeManager->getStore()->getId())) {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Algolia Search & Discovery extension for Magento 2
==================================================

![Latest version](https://img.shields.io/badge/latest-3.13.7-green)
![Latest version](https://img.shields.io/badge/latest-3.13.8-green)
![Magento 2](https://img.shields.io/badge/Magento-2.4.x-orange)

![PHP](https://img.shields.io/badge/PHP-8.2%2C8.1%2C7.4-blue)
Expand Down
34 changes: 28 additions & 6 deletions Service/Product/MissingPriceIndexHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,44 @@ class MissingPriceIndexHandler

protected array $_indexedProducts = [];

protected IndexerInterface $indexer;
/**
* @var CollectionFactory
*/
protected $productCollectionFactory;

/**
* @var ResourceConnection
*/
protected $resourceConnection;

/**
* @var Logger
*/
protected $logger;

/**
* @var IndexerInterface
*/
protected $indexer;

public function __construct(
protected CollectionFactory $productCollectionFactory,
protected ResourceConnection $resourceConnection,
protected Logger $logger,
CollectionFactory $productCollectionFactory,
ResourceConnection $resourceConnection,
Logger $logger,
IndexerRegistry $indexerRegistry
)
{
$this->productCollectionFactory = $productCollectionFactory;
$this->resourceConnection = $resourceConnection;
$this->logger = $logger;
$this->indexer = $indexerRegistry->get('catalog_product_price');
}

/**
* @param string[]|ProductCollection $products
* @return string[] Array of product IDs that were reindexed by this repair operation
*/
public function refreshPriceIndex(array|ProductCollection $products): array
public function refreshPriceIndex($products): array
{
$reindexIds = $this->getProductIdsToReindex($products);
if (empty($reindexIds)) {
Expand All @@ -54,7 +76,7 @@ public function refreshPriceIndex(array|ProductCollection $products): array
* @param string[]|ProductCollection $products - either an explicit list of product ids or a product collection
* @return string[] IDs of products that require price reindexing (will be empty if no indexing is required)
*/
protected function getProductIdsToReindex(array|ProductCollection $products): array
protected function getProductIdsToReindex($products): array
{
$productIds = $products instanceof ProductCollection
? $this->getProductIdsFromCollection($products)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Algolia Search & Discovery extension for Magento 2",
"type": "magento2-module",
"license": ["MIT"],
"version": "3.13.7",
"version": "3.13.8",
"require": {
"magento/framework": "~102.0|~103.0",
"algolia/algoliasearch-client-php": "3.3.2",
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Algolia_AlgoliaSearch" setup_version="3.13.7">
<module name="Algolia_AlgoliaSearch" setup_version="3.13.8">
<sequence>
<module name="Magento_Theme"/>
<module name="Magento_Backend"/>
Expand Down

0 comments on commit 5097489

Please sign in to comment.