File tree Expand file tree Collapse file tree 7 files changed +59
-7
lines changed
Catalog/Model/Product/Attribute/Backend/GroupPrice
dev/tests/api-functional/testsuite/Magento/GraphQl/Newsletter/Guest
lib/internal/Magento/Framework Expand file tree Collapse file tree 7 files changed +59
-7
lines changed Original file line number Diff line number Diff line change 10
10
use Magento \Catalog \Model \Attribute \ScopeOverriddenValue ;
11
11
use Magento \Catalog \Model \Product \Attribute \Backend \Price ;
12
12
use Magento \Customer \Api \GroupManagementInterface ;
13
+ use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
13
14
14
15
/**
15
16
* Catalog product abstract group price backend attribute model
16
17
*
17
18
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
18
19
*/
19
- abstract class AbstractGroupPrice extends Price
20
+ abstract class AbstractGroupPrice extends Price implements ResetAfterRequestInterface
20
21
{
21
22
/**
22
23
* @var \Magento\Framework\EntityManager\MetadataPool
@@ -26,7 +27,7 @@ abstract class AbstractGroupPrice extends Price
26
27
/**
27
28
* Website currency codes and rates
28
29
*
29
- * @var array
30
+ * @var array|null
30
31
*/
31
32
protected $ _rates ;
32
33
@@ -82,6 +83,14 @@ public function __construct(
82
83
);
83
84
}
84
85
86
+ /**
87
+ * @inheritdoc
88
+ */
89
+ public function _resetState () : void
90
+ {
91
+ $ this ->_rates = null ;
92
+ }
93
+
85
94
/**
86
95
* Retrieve websites currency rates and base currency codes
87
96
*
Original file line number Diff line number Diff line change @@ -990,5 +990,12 @@ public function _resetState(): void
990
990
{
991
991
$ this ->attributesPerSet = [];
992
992
$ this ->_attributeData = [];
993
+ foreach ($ this ->attributes as $ attributesGroupedByEntityTypeCode ) {
994
+ foreach ($ attributesGroupedByEntityTypeCode as $ attribute ) {
995
+ if ($ attribute instanceof ResetAfterRequestInterface) {
996
+ $ attribute ->_resetState ();
997
+ }
998
+ }
999
+ }
993
1000
}
994
1001
}
Original file line number Diff line number Diff line change 9
9
10
10
use Magento \Framework \Api \AttributeValueFactory ;
11
11
use Magento \Framework \Exception \LocalizedException ;
12
+ use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
12
13
use Magento \Framework \Serialize \Serializer \Json ;
13
14
14
15
/**
23
24
*/
24
25
abstract class AbstractAttribute extends \Magento \Framework \Model \AbstractExtensibleModel implements
25
26
AttributeInterface,
26
- \Magento \Eav \Api \Data \AttributeInterface
27
+ \Magento \Eav \Api \Data \AttributeInterface,
28
+ ResetAfterRequestInterface
27
29
{
28
30
const TYPE_STATIC = 'static ' ;
29
31
@@ -216,6 +218,16 @@ public function __construct(
216
218
?: \Magento \Framework \App \ObjectManager::getInstance ()->get (FrontendLabelFactory::class);
217
219
}
218
220
221
+ /**
222
+ * @inheritdoc
223
+ */
224
+ public function _resetState () : void
225
+ {
226
+ if ($ this ->_backend instanceof ResetAfterRequestInterface) {
227
+ $ this ->_backend ->_resetState ();
228
+ }
229
+ }
230
+
219
231
/**
220
232
* Get Serializer instance.
221
233
*
Original file line number Diff line number Diff line change 6
6
namespace Magento \Store \Model ;
7
7
8
8
use Magento \Framework \App \ObjectManager ;
9
- use Magento \Framework \Exception \NoSuchEntityException ;
10
- use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
11
9
use Magento \Store \Api \StoreResolverInterface ;
12
10
use Magento \Store \Model \ResourceModel \StoreWebsiteRelation ;
13
11
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ protected function setUp(): void
31
31
$ this ->subscriberResource = $ objectManager ->get (SubscriberResourceModel::class);
32
32
}
33
33
34
+ /**
35
+ * @magentoConfigFixture default_store newsletter/subscription/allow_guest_subscribe 1
36
+ */
34
37
public function testAddEmailIntoNewsletterSubscription ()
35
38
{
36
39
$ query = $ this ->getQuery ('guest@example.com ' );
@@ -41,6 +44,9 @@ public function testAddEmailIntoNewsletterSubscription()
41
44
self ::assertEquals ('SUBSCRIBED ' , $ response ['subscribeEmailToNewsletter ' ]['status ' ]);
42
45
}
43
46
47
+ /**
48
+ * @magentoConfigFixture default_store newsletter/subscription/allow_guest_subscribe 1
49
+ */
44
50
public function testNewsletterSubscriptionWithIncorrectEmailFormat ()
45
51
{
46
52
$ query = $ this ->getQuery ('guest.example.com ' );
@@ -68,6 +74,7 @@ public function testNewsletterSubscriptionWithDisallowedGuestSubscription()
68
74
69
75
/**
70
76
* @magentoApiDataFixture Magento/Newsletter/_files/guest_subscriber.php
77
+ * @magentoConfigFixture default_store newsletter/subscription/allow_guest_subscribe 1
71
78
*/
72
79
public function testNewsletterSubscriptionWithAlreadySubscribedEmail ()
73
80
{
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Framework \Acl ;
7
7
8
+ use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
9
+
8
10
/**
9
11
* Access Control List Builder. Retrieves required role/rule/resource loaders
10
12
* and uses them to populate provided ACL object. Acl object is put to cache after creation.
13
15
* @api
14
16
* @since 100.0.2
15
17
*/
16
- class Builder
18
+ class Builder implements ResetAfterRequestInterface
17
19
{
18
20
/**
19
21
* Acl object
@@ -85,4 +87,12 @@ public function resetRuntimeAcl()
85
87
$ this ->_acl = null ;
86
88
return $ this ;
87
89
}
90
+
91
+ /**
92
+ * @inheritdoc
93
+ */
94
+ public function _resetState (): void
95
+ {
96
+ $ this ->resetRuntimeAcl ();
97
+ }
88
98
}
Original file line number Diff line number Diff line change 6
6
7
7
namespace Magento \Framework \Pricing \Price ;
8
8
9
+ use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
9
10
use Magento \Framework \Pricing \SaleableInterface ;
10
11
11
12
/**
14
15
* @api
15
16
* @since 100.0.2
16
17
*/
17
- class Collection implements \Iterator
18
+ class Collection implements \Iterator, ResetAfterRequestInterface
18
19
{
19
20
/**
20
21
* @var Pool
@@ -74,6 +75,14 @@ public function __construct(
74
75
$ this ->priceModels = [];
75
76
}
76
77
78
+ /**
79
+ * @inheritdoc
80
+ */
81
+ public function _resetState () : void
82
+ {
83
+ $ this ->priceModels = [];
84
+ }
85
+
77
86
/**
78
87
* Reset the Collection to the first element
79
88
*
You can’t perform that action at this time.
0 commit comments