Skip to content

Commit 78182ac

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #20522: [Backport] Add useful debug info for which website has not been found (by @mageprince) - #20505: [Backport] Added constants to unit codes to make it easier to reuse it if necessary (by @mageprince) - #20509: [Backport] Added required error message. (by @mageprince) - #18362: [Backport] fix(Webapi Xml Renderer - 18361): removed the not needed ampersand re� (by @nickshatilo) - #20541: [Backport] Issue fixed #19985 Send email confirmation popup close button area ov� (by @irajneeshgupta) - #20184: [Backport] Fix issue 19887 creating new shipment: getting all trackers. (by @mage2pratik) Fixed GitHub Issues: - #18361: Customer last name is encoded twice in the XML interface (reported by @nickshatilo) has been fixed in #18362 by @nickshatilo in 2.2-develop branch Related commits: 1. ecd9dc4 2. 0f75306 3. ed497dc - #19985: Send email confirmation popup close button area overlapping to content (reported by @cedarvinda) has been fixed in #20541 by @irajneeshgupta in 2.2-develop branch Related commits: 1. 8d949bd 2. 2e4d7e1 - #19887: creating new shipment: gettting all trackers. after this commit 2307e16 (reported by @aldf) has been fixed in #20184 by @mage2pratik in 2.2-develop branch Related commits: 1. f8df2df 2. 8b59fc0
2 parents 401203a + ff54f4c commit 78182ac

File tree

7 files changed

+63
-27
lines changed

7 files changed

+63
-27
lines changed

app/code/Magento/Directory/Model/Config/Source/WeightUnit.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Directory\Model\Config\Source;
78

89
/**
@@ -14,10 +15,23 @@
1415
class WeightUnit implements \Magento\Framework\Option\ArrayInterface
1516
{
1617
/**
17-
* {@inheritdoc}
18+
* @var string
19+
*/
20+
const CODE_LBS = 'lbs';
21+
22+
/**
23+
* @var string
24+
*/
25+
const CODE_KGS = 'kgs';
26+
27+
/**
28+
* @inheritdoc
1829
*/
1930
public function toOptionArray()
2031
{
21-
return [['value' => 'lbs', 'label' => __('lbs')], ['value' => 'kgs', 'label' => __('kgs')]];
32+
return [
33+
['value' => self::CODE_LBS, 'label' => __('lbs')],
34+
['value' => self::CODE_KGS, 'label' => __('kgs')]
35+
];
2236
}
2337
}

app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,23 @@
99
?>
1010
<?php $_shipment = $block->getShipment() ?>
1111
<?php $_order = $block->getOrder() ?>
12-
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
13-
<br />
14-
<table class="shipment-track">
15-
<thead>
12+
<?php $trackCollection = $_order->getTracksCollection($_shipment->getId()) ?>
13+
<?php if ($_shipment && $_order && $trackCollection): ?>
14+
<br />
15+
<table class="shipment-track">
16+
<thead>
1617
<tr>
1718
<th><?= /* @escapeNotVerified */ __('Shipped By') ?></th>
1819
<th><?= /* @escapeNotVerified */ __('Tracking Number') ?></th>
1920
</tr>
20-
</thead>
21-
<tbody>
22-
<?php foreach ($_shipment->getAllTracks() as $_item): ?>
23-
<tr>
24-
<td><?= $block->escapeHtml($_item->getTitle()) ?>:</td>
25-
<td><?= $block->escapeHtml($_item->getNumber()) ?></td>
26-
</tr>
27-
<?php endforeach ?>
28-
</tbody>
29-
</table>
21+
</thead>
22+
<tbody>
23+
<?php foreach ($trackCollection as $_item): ?>
24+
<tr>
25+
<td><?= $block->escapeHtml($_item->getTitle()) ?>:</td>
26+
<td><?= $block->escapeHtml($_item->getNumber()) ?></td>
27+
</tr>
28+
<?php endforeach ?>
29+
</tbody>
30+
</table>
3031
<?php endif; ?>

app/code/Magento/Store/Model/WebsiteRepository.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,14 @@ public function get($code)
7777
]);
7878

7979
if ($website->getId() === null) {
80-
throw new NoSuchEntityException();
80+
throw new NoSuchEntityException(
81+
__(
82+
sprintf(
83+
"The website with code %s that was requested wasn't found. Verify the website and try again.",
84+
$code
85+
)
86+
)
87+
);
8188
}
8289
$this->entities[$code] = $website;
8390
$this->entitiesById[$website->getId()] = $website;
@@ -99,7 +106,14 @@ public function getById($id)
99106
]);
100107

101108
if ($website->getId() === null) {
102-
throw new NoSuchEntityException();
109+
throw new NoSuchEntityException(
110+
__(
111+
sprintf(
112+
"The website with id %s that was requested wasn't found. Verify the website and try again.",
113+
$id
114+
)
115+
)
116+
);
103117
}
104118
$this->entities[$website->getCode()] = $website;
105119
$this->entitiesById[$id] = $website;

app/design/adminhtml/Magento/backend/web/css/source/components/_modals_extend.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@
146146
}
147147

148148
.action-close {
149-
padding: @modal-popup__padding;
149+
padding: @modal-popup__padding - 2;
150150

151151
&:active,
152152
&:focus {
153153
background: transparent;
154-
padding-right: @modal-popup__padding + (@modal-action-close__font-size - @modal-action-close__active__font-size) / 2;
155-
padding-top: @modal-popup__padding + (@modal-action-close__font-size - @modal-action-close__active__font-size) / 2;
154+
padding-right: @modal-popup__padding - 2;
155+
padding-top: @modal-popup__padding - 2;
156156
}
157157
}
158158
}

lib/internal/Magento/Framework/Serialize/Serializer/Json.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@
1616
class Json implements SerializerInterface
1717
{
1818
/**
19-
* {@inheritDoc}
19+
* @inheritDoc
2020
* @since 100.2.0
2121
*/
2222
public function serialize($data)
2323
{
2424
$result = json_encode($data);
2525
if (false === $result) {
26-
throw new \InvalidArgumentException('Unable to serialize value.');
26+
throw new \InvalidArgumentException("Unable to serialize value. Error: " . json_last_error_msg());
2727
}
2828
return $result;
2929
}
3030

3131
/**
32-
* {@inheritDoc}
32+
* @inheritDoc
3333
* @since 100.2.0
3434
*/
3535
public function unserialize($string)
3636
{
3737
$result = json_decode($string, true);
3838
if (json_last_error() !== JSON_ERROR_NONE) {
39-
throw new \InvalidArgumentException('Unable to unserialize value.');
39+
throw new \InvalidArgumentException("Unable to unserialize value. Error: " . json_last_error_msg());
4040
}
4141
return $result;
4242
}

lib/internal/Magento/Framework/Webapi/Rest/Response/Renderer/Xml.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
*/
88
namespace Magento\Framework\Webapi\Rest\Response\Renderer;
99

10+
/**
11+
* Renders response data in Xml format.
12+
*/
1013
class Xml implements \Magento\Framework\Webapi\Rest\Response\RendererInterface
1114
{
1215
/**
@@ -111,8 +114,7 @@ protected function _formatValue($value)
111114
/** Without the following transformation boolean values are rendered incorrectly */
112115
$value = $value ? 'true' : 'false';
113116
}
114-
$replacementMap = ['&' => '&amp;'];
115-
return str_replace(array_keys($replacementMap), array_values($replacementMap), $value);
117+
return (string) $value;
116118
}
117119

118120
/**

lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/Response/Renderer/XmlTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ public function providerXmlRender()
7676
'<?xml version="1.0"?><response><item_7key>value</item_7key></response>',
7777
'Invalid XML render with numeric symbol in data index.'
7878
],
79+
[
80+
['key' => 'test & foo'],
81+
'<?xml version="1.0"?><response><key>test &amp; foo</key></response>',
82+
'Invalid XML render with ampersand symbol in data index.'
83+
],
7984
[
8085
['.key' => 'value'],
8186
'<?xml version="1.0"?><response><item_key>value</item_key></response>',

0 commit comments

Comments
 (0)