Skip to content

Commit 9cfff6e

Browse files
authored
Merge branch '2.4-develop' into ui-file-uploader-failure-callback
2 parents 9d99f32 + edfbc39 commit 9cfff6e

20 files changed

+309
-231
lines changed

app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/AttributeOptionProvider.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ public function getOptions(array $optionIds, ?int $storeId, array $attributeCode
6464
'attribute_label' => 'a.frontend_label',
6565
]
6666
)
67+
->joinLeft(
68+
['attribute_label' => $this->resourceConnection->getTableName('eav_attribute_label')],
69+
"a.attribute_id = attribute_label.attribute_id AND attribute_label.store_id = {$storeId}",
70+
[
71+
'attribute_store_label' => 'attribute_label.value',
72+
]
73+
)
6774
->joinLeft(
6875
['options' => $this->resourceConnection->getTableName('eav_attribute_option')],
6976
'a.attribute_id = options.attribute_id',
@@ -119,7 +126,8 @@ private function formatResult(\Magento\Framework\DB\Select $select): array
119126
$result[$option['attribute_code']] = [
120127
'attribute_id' => $option['attribute_id'],
121128
'attribute_code' => $option['attribute_code'],
122-
'attribute_label' => $option['attribute_label'],
129+
'attribute_label' => $option['attribute_store_label']
130+
? $option['attribute_store_label'] : $option['attribute_label'],
123131
'options' => [],
124132
];
125133
}

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressGridMainActionsSection.xml

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

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridMainActionsSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
<element name="multicheck" type="checkbox" selector="#container>div>div.admin__data-grid-wrap>table>thead>tr>th.data-grid-multicheck-cell>div>label"/>
1414
<element name="multicheckTick" type="checkbox" selector="#container>div>div.admin__data-grid-wrap>table>thead>tr>th.data-grid-multicheck-cell>div>input"/>
1515
<element name="delete" type="button" selector="//*[contains(@class, 'admin__data-grid-header')]//span[contains(@class,'action-menu-item') and text()='Delete']"/>
16-
<element name="actions" type="text" selector=".action-select"/>
1716
<element name="customerCheckbox" type="button" selector="//*[contains(text(),'{{arg}}')]/parent::td/preceding-sibling::td/label[@class='data-grid-checkbox-cell-inner']//input" parameterized="true"/>
1817
<element name="ok" type="button" selector="//button[@data-role='action']//span[text()='OK']"/>
18+
<element name="addNewAddress" type="button" selector=".add-new-address-button" timeout="30"/>
19+
<element name="actions" type="text" selector=".admin__data-grid-header-row .action-select"/>
1920
</section>
2021
</sections>

app/code/Magento/User/Test/Mftf/Section/AdminDeleteRoleSection.xml

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

app/code/Magento/User/Test/Mftf/Section/AdminDeleteUserSection.xml

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

app/code/Magento/User/Test/Mftf/Section/AdminRoleGridSection/AdminDeleteRoleSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="AdminDeleteRoleSection">
1111
<element name="theRole" selector="//td[contains(text(), 'Role')]" type="button"/>
12-
<element name="role" parameterized="true" selector="//td[contains(text(), '{{args}}')]" type="button"/>
12+
<element name="salesRole" selector="//td[contains(text(), 'Sales')]" type="button"/>
13+
<element name="role" parameterized="true" selector="//td[contains(@class,'col-role_name') and contains(text(), '{{roleName}}')]" type="button"/>
1314
<element name="current_pass" type="button" selector="#current_password"/>
1415
<element name="delete" selector="//button/span[contains(text(), 'Delete Role')]" type="button"/>
1516
<element name="confirm" selector="//*[@class='action-primary action-accept']" type="button"/>

app/code/Magento/User/Test/Mftf/Section/AdminUserGridSection/AdminDeleteUserSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<element name="theUser" selector="//td[contains(text(), '{{userName}}')]" type="button" parameterized="true"/>
1212
<element name="password" selector="#user_current_password" type="input"/>
1313
<element name="delete" selector="//button/span[contains(text(), 'Delete User')]" type="button"/>
14-
<element name="confirm" selector="//*[@class='action-primary action-accept']" type="button"/>
14+
<element name="confirm" selector=".action-primary.action-accept" type="button"/>
1515
<element name="role" parameterized="true" selector="//td[contains(text(), '{{args}}')]" type="button"/>
1616
</section>
1717
</sections>

app/code/Magento/Wishlist/Model/Wishlist/RemoveProductsFromWishlist.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Magento\Wishlist\Model\Wishlist;
99

10+
use Magento\Framework\Exception\LocalizedException;
1011
use Magento\Wishlist\Model\Item as WishlistItem;
1112
use Magento\Wishlist\Model\ItemFactory as WishlistItemFactory;
1213
use Magento\Wishlist\Model\ResourceModel\Item as WishlistItemResource;
@@ -63,7 +64,7 @@ public function __construct(
6364
public function execute(Wishlist $wishlist, array $wishlistItemsIds): WishlistOutput
6465
{
6566
foreach ($wishlistItemsIds as $wishlistItemId) {
66-
$this->removeItemFromWishlist((int) $wishlistItemId);
67+
$this->removeItemFromWishlist((int) $wishlistItemId, $wishlist);
6768
}
6869

6970
return $this->prepareOutput($wishlist);
@@ -73,12 +74,22 @@ public function execute(Wishlist $wishlist, array $wishlistItemsIds): WishlistOu
7374
* Remove product item from wishlist
7475
*
7576
* @param int $wishlistItemId
77+
* @param Wishlist $wishlist
7678
*
7779
* @return void
7880
*/
79-
private function removeItemFromWishlist(int $wishlistItemId): void
81+
private function removeItemFromWishlist(int $wishlistItemId, Wishlist $wishlist): void
8082
{
8183
try {
84+
if ($wishlist->getItem($wishlistItemId) == null) {
85+
throw new LocalizedException(
86+
__(
87+
'The wishlist item with ID "%id" does not belong to the wishlist',
88+
['id' => $wishlistItemId]
89+
)
90+
);
91+
}
92+
$wishlist->getItemCollection()->clear();
8293
/** @var WishlistItem $wishlistItem */
8394
$wishlistItem = $this->wishlistItemFactory->create();
8495
$this->wishlistItemResource->load($wishlistItem, $wishlistItemId);
@@ -90,6 +101,8 @@ private function removeItemFromWishlist(int $wishlistItemId): void
90101
}
91102

92103
$this->wishlistItemResource->delete($wishlistItem);
104+
} catch (LocalizedException $exception) {
105+
$this->addError($exception->getMessage());
93106
} catch (\Exception $e) {
94107
$this->addError(
95108
__(

app/code/Magento/Wishlist/Model/Wishlist/UpdateProductsInWishlist.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ public function execute(Wishlist $wishlist, array $wishlistItems): WishlistOutpu
9090
private function updateItemInWishlist(Wishlist $wishlist, WishlistItemData $wishlistItemData): void
9191
{
9292
try {
93+
if ($wishlist->getItem($wishlistItemData->getId()) == null) {
94+
throw new LocalizedException(
95+
__(
96+
'The wishlist item with ID "%id" does not belong to the wishlist',
97+
['id' => $wishlistItemData->getId()]
98+
)
99+
);
100+
}
101+
$wishlist->getItemCollection()->clear();
93102
$options = $this->buyRequestBuilder->build($wishlistItemData);
94103
/** @var WishlistItem $wishlistItem */
95104
$wishlistItem = $this->wishlistItemFactory->create();

composer.lock

Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)