Skip to content

Commit 4384bac

Browse files
authored
Merge pull request #1883 from algolia/release/3.17.1-dev
Release/3.17.1
2 parents 1810eb9 + 9c8e3f5 commit 4384bac

File tree

12 files changed

+129
-169
lines changed

12 files changed

+129
-169
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# CHANGE LOG
22

3+
## 3.17.1
4+
5+
### Updates
6+
- Removed `Magento\Catalog\Model\Product\Url` preference
7+
- Moved `algolia_algoliasearch_plugin_category_url` plugin to global area so it can be used in the new indexers
8+
- Added "Extension/Magento versions support" paragraphs to the README file.
9+
310
## 3.17.0
411

512
### Features

Model/Product/Url.php

Lines changed: 0 additions & 150 deletions
This file was deleted.

README.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Algolia Search & Discovery extension for Magento 2
22
==================================================
33

4-
![Latest version](https://img.shields.io/badge/latest-3.17.0-green)
4+
![Latest version](https://img.shields.io/badge/latest-3.17.1-green)
55
![Magento 2](https://img.shields.io/badge/Magento-2.4.7+-orange)
66

7-
![PHP](https://img.shields.io/badge/PHP-8.1%2C8.2%2C8.3%2C8.4-blue)
7+
![PHP](https://img.shields.io/badge/PHP-8.2%2C8.3%2C8.4-blue)
88

99
[![CircleCI](https://circleci.com/gh/algolia/algoliasearch-magento-2/tree/main.svg?style=svg)](https://circleci.com/gh/algolia/algoliasearch-magento-2/tree/main)
1010

@@ -35,6 +35,16 @@ Magento 2.3 and earlier versions are no longer supported by the Algolia extensio
3535

3636
Version 3.x of our extension is compatible with Magento 2.4. Review the [Customisation](https://github.com/algolia/algoliasearch-magento-2#customisation) section to learn more about the differences between our extension versions.
3737

38+
### Extension versions support
39+
40+
We support the two latest minor versions of our extension (see "Extension Version" column in the compatibility matrix below) :
41+
- The 2 latest minor versions are maintained with security and critical bug fixes.
42+
- The latest minor version is maintained with "general" bug fixes as well.
43+
44+
### Magento versions support
45+
46+
We support the 2 or 3 latest patch versions of Magento depending on releases overlap (see matrix below):
47+
3848
| Extension Version | End of Life | Magento | PHP |
3949
|-------------------|-------------|------------------------------|----------------------------------------|
4050
| v3.7.x | 10/10/2023 | `~2.3.7\|\|~2.4.5\|\|~2.4.6` | `~7.3.0\|\|~7.4.0\|\|~8.1.0\|\|~8.2.0` |
@@ -45,8 +55,9 @@ Version 3.x of our extension is compatible with Magento 2.4. Review the [Customi
4555
| v3.12.x | 8/2/2024 | `~2.4.6` | `~8.1.0\|\|~8.2.0` |
4656
| v3.13.x | 4/9/2025 | `~2.4.6` | `~8.1.0\|\|~8.2.0` |
4757
| v3.14.x | 9/1/2025 | `~2.4.6\|\|~2.4.7` | `~8.1.0\|\|~8.2.0\|\|~8.3.0` |
48-
| v3.15.x | N/A | `~2.4.6\|\|~2.4.7` | `~8.1.0\|\|~8.2.0\|\|~8.3.0` |
58+
| v3.15.x | 12/1/2025 | `~2.4.6\|\|~2.4.7` | `~8.1.0\|\|~8.2.0\|\|~8.3.0` |
4959
| v3.16.x | N/A | `~2.4.7\|\|~2.4.8` | `~8.2.0\|\|~8.3.0\|\|~8.4.0` |
60+
| v3.17.x | N/A | `~2.4.7\|\|~2.4.8` | `~8.2.0\|\|~8.3.0\|\|~8.4.0` |
5061

5162
## Documentation
5263

@@ -80,15 +91,15 @@ Please check our [Custom Extension](https://github.com/algolia/algoliasearch-cus
8091
Knowing the version of each Algolia JavaScript library will help you understand what is available for you to leverage in terms of customisation. This table will help you determine which documentation to reference when you start working on your customisation.
8192

8293
| Extension Version | autocomplete.js | instantsearch.js | search-insights.js | recommend-js.js |
83-
|-------------------|--------------------------------------------------------------------|--------------------------------------------------------------------------------|----------------------------------------------------------------------|-------------------------------------------------------------|
84-
| v3.x | [0.38.0](https://github.com/algolia/autocomplete.js/tree/v0.38.0)* | [4.15.0](https://github.com/algolia/instantsearch.js/tree/v4.15.0)* | [1.7.1](https://github.com/algolia/search-insights.js/tree/v1.7.1) | NA |
85-
| v3.9.1 | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3)* | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0)* | [1.7.1](https://github.com/algolia/search-insights.js/tree/v1.7.1) | [1.5.0](https://github.com/algolia/recommend/tree/v1.5.0) |
86-
| v3.10.x | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3)* | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0)* | [1.7.1](https://github.com/algolia/search-insights.js/tree/v1.7.1) | [1.8.0](https://github.com/algolia/recommend/tree/v1.8.0) |
87-
| v3.11.0 | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3)* | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0)* | [2.6.0](https://github.com/algolia/search-insights.js/tree/v2.6.0) | [1.8.0](https://github.com/algolia/recommend/tree/v1.8.0) |
88-
| v3.13.0 | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3)* | [4.63.0](https://github.com/algolia/instantsearch/tree/instantsearch.js%404.63.0)* | [2.11.0](https://github.com/algolia/search-insights.js/tree/v2.11.0) | [1.8.0](https://github.com/algolia/recommend/tree/v1.8.0) |
89-
| v3.14.x | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3)* | [4.63.0](https://github.com/algolia/instantsearch/tree/instantsearch.js%404.63.0)* | [2.11.0](https://github.com/algolia/search-insights.js/tree/v2.11.0) | [1.15.0](https://github.com/algolia/recommend/tree/v1.15.0) |
90-
| v3.15.x | [1.17.9](https://github.com/algolia/autocomplete.js/tree/v1.17.9) | [4.77.0](https://github.com/algolia/instantsearch/tree/instantsearch.js%404.77.0) | [2.17.3](https://github.com/algolia/search-insights.js/tree/v2.17.3) | [1.16.0](https://github.com/algolia/recommend/tree/v1.16.0) |
91-
| v3.16.x | [1.18.1](https://github.com/algolia/autocomplete.js/tree/v1.18.1) | [4.78.0](https://github.com/algolia/instantsearch/tree/instantsearch.js%404.78.0) | [2.17.3](https://github.com/algolia/search-insights.js/tree/v2.17.3) | [1.16.0](https://github.com/algolia/recommend/tree/v1.16.0) |
94+
|-----------------|--------------------------------------------------------------------|--------------------------------------------------------------------------------|----------------------------------------------------------------------|-------------------------------------------------------------|
95+
| v3.x | [0.38.0](https://github.com/algolia/autocomplete.js/tree/v0.38.0)* | [4.15.0](https://github.com/algolia/instantsearch.js/tree/v4.15.0)* | [1.7.1](https://github.com/algolia/search-insights.js/tree/v1.7.1) | NA |
96+
| v3.9.1 | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3)* | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0)* | [1.7.1](https://github.com/algolia/search-insights.js/tree/v1.7.1) | [1.5.0](https://github.com/algolia/recommend/tree/v1.5.0) |
97+
| v3.10.x | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3)* | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0)* | [1.7.1](https://github.com/algolia/search-insights.js/tree/v1.7.1) | [1.8.0](https://github.com/algolia/recommend/tree/v1.8.0) |
98+
| v3.11.0 | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3)* | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0)* | [2.6.0](https://github.com/algolia/search-insights.js/tree/v2.6.0) | [1.8.0](https://github.com/algolia/recommend/tree/v1.8.0) |
99+
| v3.13.0 | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3)* | [4.63.0](https://github.com/algolia/instantsearch/tree/instantsearch.js%404.63.0)* | [2.11.0](https://github.com/algolia/search-insights.js/tree/v2.11.0) | [1.8.0](https://github.com/algolia/recommend/tree/v1.8.0) |
100+
| v3.14.x | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3)* | [4.63.0](https://github.com/algolia/instantsearch/tree/instantsearch.js%404.63.0)* | [2.11.0](https://github.com/algolia/search-insights.js/tree/v2.11.0) | [1.15.0](https://github.com/algolia/recommend/tree/v1.15.0) |
101+
| v3.15.x | [1.17.9](https://github.com/algolia/autocomplete.js/tree/v1.17.9) | [4.77.0](https://github.com/algolia/instantsearch/tree/instantsearch.js%404.77.0) | [2.17.3](https://github.com/algolia/search-insights.js/tree/v2.17.3) | [1.16.0](https://github.com/algolia/recommend/tree/v1.16.0) |
102+
| >=v3.16.x | [1.18.1](https://github.com/algolia/autocomplete.js/tree/v1.18.1) | [4.78.0](https://github.com/algolia/instantsearch/tree/instantsearch.js%404.78.0) | [2.17.3](https://github.com/algolia/search-insights.js/tree/v2.17.3) | [1.16.0](https://github.com/algolia/recommend/tree/v1.16.0) |
92103

93104
* In earlier versions of the extension, the Autocomplete and InstantSearch libraries were accessible via the `algoliaBundle` global. This bundle was a prepackaged JavaScript file that contained dependencies for the frontend experience. What was included in this bundle can be seen here: https://github.com/algolia/algoliasearch-extensions-bundle/blob/ISv4/package.json
94105

Test/Integration/Indexing/Category/MultiStoreCategoriesTest.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory;
1212
use Magento\Framework\Exception\CouldNotSaveException;
1313
use Magento\Framework\Exception\NoSuchEntityException;
14+
use Magento\Store\Api\Data\StoreInterface;
1415

1516
/**
16-
* @magentoDataFixture Magento/Store/_files/second_website_with_two_stores.php
17+
* @magentoDataFixture Algolia_AlgoliaSearch::Test/Integration/_files/second_website_with_two_stores_and_products.php
1718
* @magentoDbIsolation disabled
1819
* @magentoAppIsolation enabled
1920
*/
@@ -64,6 +65,20 @@ public function testMultiStoreCategoryIndices()
6465
$defaultStore = $this->storeRepository->get('default');
6566
$fixtureSecondStore = $this->storeRepository->get('fixture_second_store');
6667

68+
// Check the base url of the categories
69+
$this->validateEntityUrl(
70+
'categories',
71+
self::BAGS_CATEGORY_ID,
72+
$defaultStore,
73+
"http://default.test/"
74+
);
75+
$this->validateEntityUrl(
76+
'categories',
77+
self::BAGS_CATEGORY_ID,
78+
$fixtureSecondStore,
79+
"http://fixture_second_store.test/"
80+
);
81+
6782
$bagsCategory = $this->loadCategory(self::BAGS_CATEGORY_ID, $defaultStore->getId());
6883

6984
$this->assertEquals(self::BAGS_CATEGORY_NAME, $bagsCategory->getName());

Test/Integration/Indexing/MultiStoreTestCase.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,23 @@ protected function setupStore(StoreInterface $store, bool $enableInstantSearch =
123123
$this->indicesConfigurator->saveConfigurationToAlgolia($store->getId());
124124
}
125125

126+
/**
127+
* Fetch a category from an index and check its base url
128+
*
129+
* @param StoreInterface $store
130+
* @param string $baseUrl
131+
* @return void
132+
* @throws NoSuchEntityException
133+
* @throws AlgoliaException
134+
*/
135+
protected function validateEntityUrl(string $entity, string $entityId, StoreInterface $store, string $baseUrl): void
136+
{
137+
$indexOptions = $this->getIndexOptions($entity, $store->getId());
138+
$results = $this->algoliaConnector->getObjects($indexOptions, [$entityId]);
139+
$hit = reset($results['results']);
140+
$this->assertStringContainsString($baseUrl, $hit['url']);
141+
}
142+
126143
/**
127144
* @throws ExceededRetriesException
128145
* @throws AlgoliaException

Test/Integration/Indexing/Product/MultiStoreProductsTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Algolia\AlgoliaSearch\Test\Integration\Indexing\Product;
44

5+
use Algolia\AlgoliaSearch\Exceptions\AlgoliaException;
56
use Algolia\AlgoliaSearch\Service\Product\BatchQueueProcessor as ProductBatchQueueProcessor;
67
use Algolia\AlgoliaSearch\Test\Integration\Indexing\MultiStoreTestCase;
78
use Magento\Catalog\Api\Data\ProductInterface;
@@ -10,6 +11,7 @@
1011
use Magento\Framework\Exception\CouldNotSaveException;
1112
use Magento\Framework\Exception\NoSuchEntityException;
1213
use Magento\Framework\Indexer\IndexerRegistry;
14+
use Magento\Store\Api\Data\StoreInterface;
1315
use Magento\Store\Api\WebsiteRepositoryInterface;
1416

1517
/**
@@ -117,6 +119,29 @@ public function testMultiStoreProductIndices()
117119
$fixtureSecondStore->getId()
118120
);
119121

122+
// Check the base url of the products
123+
$this->validateEntityUrl(
124+
'products',
125+
self::VOYAGE_YOGA_BAG_ID,
126+
$defaultStore,
127+
"http://default.test/"
128+
);
129+
130+
$this->validateEntityUrl(
131+
'products',
132+
self::VOYAGE_YOGA_BAG_ID,
133+
$fixtureSecondStore,
134+
"http://fixture_second_store.test/"
135+
);
136+
137+
$this->validateEntityUrl(
138+
'products',
139+
self::VOYAGE_YOGA_BAG_ID,
140+
$fixtureThirdStore,
141+
"http://fixture_third_store.test/"
142+
);
143+
144+
120145
// Unassign product from a single website (removed from test website (second and third store))
121146
$baseWebsite = $this->websiteRepository->get('base');
122147

Test/Integration/TestCase.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Algolia\AlgoliaSearch\Test\Integration;
44

5+
use Algolia\AlgoliaSearch\Api\Data\IndexOptionsInterface;
56
use Algolia\AlgoliaSearch\Exceptions\AlgoliaException;
67
use Algolia\AlgoliaSearch\Exceptions\ExceededRetriesException;
78
use Algolia\AlgoliaSearch\Helper\ConfigHelper;
@@ -21,6 +22,8 @@
2122

2223
abstract class TestCase extends \Algolia\AlgoliaSearch\Test\TestCase
2324
{
25+
const DEFAULT_STORE_ID = 1;
26+
2427
/**
2528
* @var ObjectManagerInterface
2629
*/
@@ -262,4 +265,20 @@ function runOnce(callable $callback, ?string $key = null): mixed
262265

263266
return null;
264267
}
268+
269+
/**
270+
* @param string $indexSuffix
271+
* @param int|null $storeId
272+
* @param bool|null $isTmp
273+
* @return IndexOptionsInterface
274+
* @throws NoSuchEntityException
275+
*/
276+
protected function getIndexOptions(
277+
string $indexSuffix,
278+
?int $storeId = self::DEFAULT_STORE_ID,
279+
?bool $isTmp = null
280+
): IndexOptionsInterface
281+
{
282+
return $this->indexOptionsBuilder->buildWithComputedIndex('_' . $indexSuffix, $storeId, $isTmp);
283+
}
265284
}

0 commit comments

Comments
 (0)