Skip to content

Commit 3f7dcf0

Browse files
committed
Merge branch '2.4-develop' of https://github.com/magento-commerce/magento2ce into ACP2E-182
2 parents 1adecf4 + d0dccd8 commit 3f7dcf0

File tree

6 files changed

+64
-13
lines changed

6 files changed

+64
-13
lines changed

app/code/Magento/Catalog/etc/acl.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<resource id="Magento_Catalog::catalog" title="Catalog" translate="title" sortOrder="30">
1313
<resource id="Magento_Catalog::catalog_inventory" title="Inventory" translate="title" sortOrder="10">
1414
<resource id="Magento_Catalog::products" title="Products" translate="title" sortOrder="10">
15-
<resource id="Magento_Catalog::update_attributes" title="Update Attributes" translate="title" sortOrder="10" />
15+
<resource id="Magento_Catalog::update_attributes" title="Mass Update Attributes" translate="title" sortOrder="10" />
1616
<resource id="Magento_Catalog::edit_product_design" title="Edit Product Design" translate="title" sortOrder="20" />
1717
</resource>
1818
<resource id="Magento_Catalog::categories" title="Categories" translate="title" sortOrder="20">
@@ -27,7 +27,7 @@
2727
</resource>
2828
</resource>
2929
<resource id="Magento_Backend::stores_attributes">
30-
<resource id="Magento_Catalog::attributes_attributes" title="Product" translate="title" sortOrder="30" />
30+
<resource id="Magento_Catalog::attributes_attributes" title="Product" translate="title" sortOrder="30"/>
3131
<resource id="Magento_Catalog::sets" title="Attribute Set" translate="title" sortOrder="40"/>
3232
</resource>
3333
</resource>

app/code/Magento/Catalog/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Quantity,Quantity
148148
Edit,Edit
149149
"Are you sure?","Are you sure?"
150150
"Change Status","Change Status"
151-
"Update Attributes","Update Attributes"
151+
"Mass Update Attributes","Mass Update Attributes"
152152
"start typing to search category","start typing to search category"
153153
"New Category","New Category"
154154
"Images (.gif, .jpg, .png)","Images (.gif, .jpg, .png)"

app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<div class="action-dropdown-menu-item-edit" visible="customVisible">
2121
<input class="admin__control-text" type="text"
2222
data-bind="
23+
attr: {'aria-label': $t('New View')},
2324
value: customLabel,
2425
hasFocus: isCustomVisible(),
2526
keyboard: {

dev/tests/integration/testsuite/Magento/Framework/MessageQueue/TopologyTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function testTopologyInstallation(array $expectedConfig, array $bindingCo
5555
$this->assertArrayHasKey($name, $this->declaredExchanges);
5656
unset(
5757
$this->declaredExchanges[$name]['message_stats'],
58-
$this->declaredExchanges[$name]['user_who_performed_action']
58+
$this->declaredExchanges[$name]['user_who_performed_action'],
59+
$this->declaredExchanges[$name]['policy']
5960
);
6061

6162
$this->assertEquals(

lib/internal/Magento/Framework/Session/SaveHandler.php

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
66

77
namespace Magento\Framework\Session;
88

9+
use Magento\Framework\App\Area;
10+
use Magento\Framework\App\ObjectManager;
11+
use Magento\Framework\App\State;
912
use Magento\Framework\Exception\LocalizedException;
1013
use Magento\Framework\Exception\SessionException;
14+
use Magento\Framework\Message\ManagerInterface;
1115
use Magento\Framework\Session\Config\ConfigInterface;
1216
use Psr\Log\LoggerInterface;
1317

1418
/**
1519
* Magento session save handler.
20+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1621
*/
1722
class SaveHandler implements SaveHandlerInterface
1823
{
@@ -48,25 +53,41 @@ class SaveHandler implements SaveHandlerInterface
4853
*/
4954
private $sessionMaxSizeConfig;
5055

56+
/**
57+
* @var ManagerInterface
58+
*/
59+
private $messageManager;
60+
61+
/**
62+
* @var State|mixed
63+
*/
64+
private $appState;
65+
5166
/**
5267
* @param SaveHandlerFactory $saveHandlerFactory
5368
* @param ConfigInterface $sessionConfig
5469
* @param LoggerInterface $logger
5570
* @param SessionMaxSizeConfig $sessionMaxSizeConfigs
5671
* @param string $default
72+
* @param ManagerInterface|null $messageManager
73+
* @param State|null $appState
5774
*/
5875
public function __construct(
5976
SaveHandlerFactory $saveHandlerFactory,
6077
ConfigInterface $sessionConfig,
6178
LoggerInterface $logger,
6279
SessionMaxSizeConfig $sessionMaxSizeConfigs,
63-
$default = self::DEFAULT_HANDLER
80+
$default = self::DEFAULT_HANDLER,
81+
ManagerInterface $messageManager = null,
82+
State $appState = null
6483
) {
6584
$this->saveHandlerFactory = $saveHandlerFactory;
6685
$this->sessionConfig = $sessionConfig;
6786
$this->logger = $logger;
6887
$this->defaultHandler = $default;
6988
$this->sessionMaxSizeConfig = $sessionMaxSizeConfigs;
89+
$this->messageManager = $messageManager ?: ObjectManager::getInstance()->get(ManagerInterface::class);
90+
$this->appState = $appState ?: ObjectManager::getInstance()->get(State::class);
7091
}
7192

7293
/**
@@ -99,10 +120,22 @@ public function close()
99120
* @param string $sessionId
100121
* @return string
101122
*/
102-
#[\ReturnTypeWillChange]
103-
public function read($sessionId)
123+
public function read($sessionId): string
104124
{
105-
return $this->callSafely('read', $sessionId);
125+
$sessionData = $this->callSafely('read', $sessionId);
126+
$sessionMaxSize = $this->sessionMaxSizeConfig->getSessionMaxSize();
127+
$sessionSize = strlen($sessionData);
128+
129+
if ($sessionSize !== null && $sessionMaxSize < $sessionSize) {
130+
$sessionData = '';
131+
if ($this->appState->getAreaCode() === Area::AREA_FRONTEND) {
132+
$this->messageManager->addErrorMessage(
133+
__('There is an error. Please Contact store administrator.')
134+
);
135+
}
136+
}
137+
138+
return $sessionData;
106139
}
107140

108141
/**
@@ -131,7 +164,7 @@ public function write($sessionId, $data)
131164
)
132165
);
133166

134-
return $this->callSafely('write', $sessionId, $this->read($sessionId));
167+
return $this->callSafely('write', $sessionId, $data);
135168
}
136169

137170
/**

lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,33 @@ public function testWriteSessionMaxSizeNull()
119119
$this->assertTrue($this->saveHandler->write("test_session_id", "testdata"));
120120
}
121121

122-
public function testWriteMoreThanSessionMaxSize()
122+
public function testWriteMoreThanSessionMaxSize(): void
123123
{
124-
$this->sessionMaxSizeConfigMock->expects($this->once())
124+
$this->sessionMaxSizeConfigMock
125+
->expects($this->once())
126+
->method('getSessionMaxSize')
127+
->willReturn(1);
128+
129+
$this->saveHandlerAdapterMock
130+
->expects($this->never())
131+
->method('read');
132+
133+
$this->assertTrue($this->saveHandler->write("test_session_id", "testdata"));
134+
}
135+
136+
public function testReadMoreThanSessionMaxSize(): void
137+
{
138+
$this->sessionMaxSizeConfigMock
139+
->expects($this->once())
125140
->method('getSessionMaxSize')
126141
->willReturn(1);
127142

128-
$this->saveHandlerAdapterMock->expects($this->once())
143+
$this->saveHandlerAdapterMock
144+
->expects($this->once())
129145
->method('read')
130146
->with('test_session_id')
131147
->willReturn('test_session_data');
132148

133-
$this->assertTrue($this->saveHandler->write("test_session_id", "testdata"));
149+
$this->assertEquals(null, $this->saveHandler->read("test_session_id"));
134150
}
135151
}

0 commit comments

Comments
 (0)