Skip to content

Commit 18e66f0

Browse files
authored
Merge pull request #1477 from algolia/release/3.13.2
MAGE-826 Release/3.13.2
2 parents db1f4fe + bbe8fd6 commit 18e66f0

File tree

30 files changed

+445
-158
lines changed

30 files changed

+445
-158
lines changed

Block/Adminhtml/Category/Merchandising.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
use Algolia\AlgoliaSearch\Helper\Data;
77
use Magento\Backend\Block\Template\Context;
88
use Magento\Catalog\Model\Category;
9-
use Magento\Framework\Registry;
9+
use Algolia\AlgoliaSearch\Registry\CurrentCategory;
1010

1111
class Merchandising extends \Magento\Backend\Block\Template
1212
{
1313
/** @var string */
1414
protected $_template = 'catalog/category/edit/merchandising.phtml';
1515

16-
/** @var Registry */
17-
protected $registry;
16+
/** @var CurrentCategory */
17+
protected $currentCategory;
1818

1919
/** @var ConfigHelper */
2020
private $configHelper;
@@ -27,19 +27,19 @@ class Merchandising extends \Magento\Backend\Block\Template
2727

2828
/**
2929
* @param Context $context
30-
* @param Registry $registry
30+
* @param CurrentCategory $currentCategory
3131
* @param ConfigHelper $configHelper
3232
* @param Data $coreHelper
3333
* @param array $data
3434
*/
3535
public function __construct(
3636
Context $context,
37-
Registry $registry,
37+
CurrentCategory $currentCategory,
3838
ConfigHelper $configHelper,
3939
Data $coreHelper,
4040
array $data = []
4141
) {
42-
$this->registry = $registry;
42+
$this->currentCategory = $currentCategory;
4343
$this->configHelper = $configHelper;
4444
$this->coreHelper = $coreHelper;
4545
$this->storeManager = $context->getStoreManager();
@@ -50,7 +50,7 @@ public function __construct(
5050
/** @return Category | null */
5151
public function getCategory()
5252
{
53-
return $this->registry->registry('category');
53+
return $this->currentCategory->get();
5454
}
5555

5656
/** @return bool */

Block/Adminhtml/Job/View.php

100644100755
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,27 @@
33
namespace Algolia\AlgoliaSearch\Block\Adminhtml\Job;
44

55
use Magento\Backend\Block\Widget\Button;
6-
use Magento\Framework\Registry;
6+
use Magento\Framework\Session\SessionManagerInterface;
77
use Magento\Framework\View\Element\Template;
88
use Magento\Framework\View\Element\Template\Context;
99

1010
class View extends Template
1111
{
12-
/** @var \Magento\Framework\Registry */
13-
protected $coreRegistry;
12+
/** @var SessionManagerInterface */
13+
protected $backendSession;
1414

1515
/**
16-
* @param Context $context
17-
* @param Registry $coreRegistry
18-
* @param array $data
16+
* @param Context $context
17+
* @param SessionManagerInterface $backendSession
18+
* @param array $data
1919
*/
2020
public function __construct(
21-
Context $context,
22-
Registry $coreRegistry,
21+
Context $context,
22+
SessionManagerInterface $backendSession,
2323
array $data = []
2424
) {
2525
parent::__construct($context, $data);
26-
27-
$this->coreRegistry = $coreRegistry;
26+
$this->backendSession = $backendSession;
2827
}
2928

3029
/** @inheritdoc */
@@ -48,7 +47,7 @@ protected function _prepareLayout()
4847
/** @return \Algolia\AlgoliaSearch\Model\Job */
4948
public function getCurrentJob()
5049
{
51-
return $this->coreRegistry->registry('current_job');
50+
return $this->backendSession->getData('current_job');
5251
}
5352

5453
/** @return string */

Block/Adminhtml/LandingPage/SearchConfiguration.php

100644100755
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
use Algolia\AlgoliaSearch\Helper\Data;
77
use Algolia\AlgoliaSearch\Model\LandingPage;
88
use Magento\Backend\Block\Template\Context;
9-
use Magento\Framework\Registry;
9+
use Magento\Framework\Session\SessionManagerInterface;
1010

1111
class SearchConfiguration extends \Magento\Backend\Block\Template
1212
{
1313
/** @var string */
1414
protected $_template = 'landingpage/search-configuration.phtml';
1515

16-
/** @var Registry */
17-
protected $registry;
16+
/** @var SessionManagerInterface */
17+
protected $backendSession;
1818

1919
/** @var ConfigHelper */
2020
private $configHelper;
@@ -27,19 +27,19 @@ class SearchConfiguration extends \Magento\Backend\Block\Template
2727

2828
/**
2929
* @param Context $context
30-
* @param Registry $registry
30+
* @param SessionManagerInterface $backendSession
3131
* @param ConfigHelper $configHelper
3232
* @param Data $coreHelper
3333
* @param array $data
3434
*/
3535
public function __construct(
3636
Context $context,
37-
Registry $registry,
37+
SessionManagerInterface $backendSession,
3838
ConfigHelper $configHelper,
3939
Data $coreHelper,
4040
array $data = []
4141
) {
42-
$this->registry = $registry;
42+
$this->backendSession = $backendSession;
4343
$this->configHelper = $configHelper;
4444
$this->coreHelper = $coreHelper;
4545

@@ -49,7 +49,7 @@ public function __construct(
4949
/** @return LandingPage | null */
5050
public function getLandingPage()
5151
{
52-
return $this->registry->registry('algoliasearch_landing_page');
52+
return $this->backendSession->getData('algoliasearch_landing_page');
5353
}
5454

5555
/** @return ConfigHelper */

Block/Adminhtml/Query/Merchandising.php

100644100755
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
use Algolia\AlgoliaSearch\Helper\Data;
77
use Algolia\AlgoliaSearch\Model\Query;
88
use Magento\Backend\Block\Template\Context;
9-
use Magento\Framework\Registry;
9+
use Magento\Framework\Session\SessionManagerInterface;
1010

1111
class Merchandising extends \Magento\Backend\Block\Template
1212
{
1313
/** @var string */
1414
protected $_template = 'query/edit/merchandising.phtml';
1515

16-
/** @var Registry */
17-
protected $registry;
16+
/** @var SessionManagerInterface */
17+
protected $backendSession;
1818

1919
/** @var ConfigHelper */
2020
private $configHelper;
@@ -27,19 +27,19 @@ class Merchandising extends \Magento\Backend\Block\Template
2727

2828
/**
2929
* @param Context $context
30-
* @param Registry $registry
30+
* @param SessionManagerInterface $backendSession
3131
* @param ConfigHelper $configHelper
3232
* @param Data $coreHelper
3333
* @param array $data
3434
*/
3535
public function __construct(
3636
Context $context,
37-
Registry $registry,
37+
SessionManagerInterface $backendSession,
3838
ConfigHelper $configHelper,
3939
Data $coreHelper,
4040
array $data = []
4141
) {
42-
$this->registry = $registry;
42+
$this->backendSession = $backendSession;
4343
$this->configHelper = $configHelper;
4444
$this->coreHelper = $coreHelper;
4545
$this->storeManager = $context->getStoreManager();
@@ -50,7 +50,7 @@ public function __construct(
5050
/** @return Query | null */
5151
public function getCurrentQuery()
5252
{
53-
return $this->registry->registry('algoliasearch_query');
53+
return $this->backendSession->getData('algoliasearch_query');
5454
}
5555

5656
/** @return ConfigHelper */

Block/Adminhtml/QueueArchive/View.php

100644100755
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@
33
namespace Algolia\AlgoliaSearch\Block\Adminhtml\QueueArchive;
44

55
use Magento\Backend\Block\Widget\Button;
6-
use Magento\Framework\Registry;
6+
use Magento\Framework\Session\SessionManagerInterface;
77
use Magento\Framework\View\Element\Template;
88
use Magento\Framework\View\Element\Template\Context;
99

1010
class View extends Template
1111
{
12-
/** @var Registry */
13-
protected $coreRegistry;
12+
/** @var SessionManagerInterface */
13+
protected $backendSession;
1414

1515
/**
16-
* @param Context $context
17-
* @param Registry $coreRegistry
18-
* @param array $data
16+
* @param Context $context
17+
* @param SessionManagerInterface $backendSession
18+
* @param array $data
1919
*/
2020
public function __construct(
21-
Context $context,
22-
Registry $coreRegistry,
21+
Context $context,
22+
SessionManagerInterface $backendSession,
2323
array $data = []
2424
) {
2525
parent::__construct($context, $data);
2626

27-
$this->coreRegistry = $coreRegistry;
27+
$this->backendSession = $backendSession;
2828
}
2929

3030
/** @inheritdoc */
@@ -48,7 +48,7 @@ protected function _prepareLayout()
4848
/** @return \Algolia\AlgoliaSearch\Model\QueueArchive */
4949
public function getCurrentJob()
5050
{
51-
return $this->coreRegistry->registry('current_job');
51+
return $this->backendSession->getData('current_job');
5252
}
5353

5454
/** @return string */

Block/Algolia.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use Magento\Framework\Data\Form\FormKey;
2121
use Magento\Framework\Locale\Currency;
2222
use Magento\Framework\Locale\Format;
23-
use Magento\Framework\Registry;
23+
use Algolia\AlgoliaSearch\Registry\CurrentProduct;
2424
use Magento\Framework\Stdlib\DateTime\DateTime;
2525
use Magento\Framework\Url\Helper\Data;
2626
use Magento\Framework\View\Element\Template;
@@ -38,9 +38,9 @@ class Algolia extends Template implements CollectionDataSourceInterface
3838
*/
3939
protected $catalogSearchHelper;
4040
/**
41-
* @var Registry
41+
* @var CurrentProduct
4242
*/
43-
protected $registry;
43+
protected $currentProduct;
4444
/**
4545
* @var ProductHelper
4646
*/
@@ -110,7 +110,7 @@ class Algolia extends Template implements CollectionDataSourceInterface
110110
* @param ProductHelper $productHelper
111111
* @param Currency $currency
112112
* @param Format $format
113-
* @param Registry $registry
113+
* @param CurrentProduct $currentProduct
114114
* @param AlgoliaHelper $algoliaHelper
115115
* @param Data $urlHelper
116116
* @param FormKey $formKey
@@ -131,7 +131,7 @@ public function __construct(
131131
ProductHelper $productHelper,
132132
Currency $currency,
133133
Format $format,
134-
Registry $registry,
134+
CurrentProduct $currentProduct,
135135
AlgoliaHelper $algoliaHelper,
136136
Data $urlHelper,
137137
FormKey $formKey,
@@ -151,7 +151,7 @@ public function __construct(
151151
$this->productHelper = $productHelper;
152152
$this->currency = $currency;
153153
$this->format = $format;
154-
$this->registry = $registry;
154+
$this->currentProduct = $currentProduct;
155155
$this->algoliaHelper = $algoliaHelper;
156156
$this->urlHelper = $urlHelper;
157157
$this->formKey = $formKey;
@@ -267,7 +267,7 @@ public function getCurrentCategory()
267267
/** @return Product */
268268
public function getCurrentProduct()
269269
{
270-
return $this->registry->registry('product');
270+
return $this->currentProduct->get();
271271
}
272272

273273
/** @return Order */

Block/RecommendProductView.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
use Magento\Catalog\Model\Product;
1010
use Algolia\AlgoliaSearch\Helper\ConfigHelper;
11-
use Magento\Framework\Registry;
11+
use Algolia\AlgoliaSearch\Registry\CurrentProduct;
1212
use Magento\Framework\View\Element\Template;
1313
use Magento\Framework\View\Element\Template\Context;
1414

@@ -20,11 +20,9 @@ class RecommendProductView extends Template
2020
protected $product = null;
2121

2222
/**
23-
* Core registry
24-
*
25-
* @var Registry
23+
* @var CurrentProduct
2624
*/
27-
protected $coreRegistry = null;
25+
protected $currentProduct;
2826

2927
/**
3028
* @var ConfigHelper
@@ -33,17 +31,17 @@ class RecommendProductView extends Template
3331

3432
/**
3533
* @param Context $context
36-
* @param Registry $registry
34+
* @param CurrentProduct $currentProduct
3735
* @param ConfigHelper $configHelper
3836
* @param array $data
3937
*/
4038
public function __construct(
4139
Context $context,
42-
Registry $registry,
40+
CurrentProduct $currentProduct,
4341
ConfigHelper $configHelper,
4442
array $data = []
4543
) {
46-
$this->coreRegistry = $registry;
44+
$this->currentProduct = $currentProduct;
4745
$this->configHelper = $configHelper;
4846
parent::__construct($context, $data);
4947
}
@@ -56,7 +54,7 @@ public function __construct(
5654
public function getProduct()
5755
{
5856
if (!$this->product) {
59-
$this->product = $this->coreRegistry->registry('product');
57+
$this->product = $this->currentProduct->get();
6058
}
6159
return $this->product;
6260
}

CHANGELOG.md

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

3+
## 3.13.2
4+
5+
### Updates
6+
- Updated code to refactor the deprecated usage of the registry in the extension
7+
- Updated the code to prevent the creation of indexer for websites excluded in customer groups
8+
- Removed the unused polyfill script from the extension.
9+
10+
### Bug Fixes
11+
- Fixed issue with the special price range for configurable products
12+
- Fixed issue with tier prices
13+
- Fixed issue causing duplicate replica errors to occur when saving the configuration.
14+
15+
316
## 3.13.1
417

518
### Bug Fixes

0 commit comments

Comments
 (0)