Skip to content

Commit 10d303f

Browse files
committed
Merge pull request #345 from magento-folks/bugs
[Folks] Bug-fix S69
2 parents 463c715 + 36294d0 commit 10d303f

File tree

9 files changed

+75
-23
lines changed

9 files changed

+75
-23
lines changed

app/code/Magento/Backend/view/adminhtml/templates/widget/grid.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $numColumns = sizeof($block->getColumns());
3131

3232
<div class="admin__data-grid-header admin__data-grid-toolbar">
3333
<?php $massActionAvailable = $block->getChildBlock('grid.massaction') && $block->getChildBlock('grid.massaction')->isAvailable() ?>
34-
<?php if ($block->getPagerVisibility() || $block->getExportTypes() || $block->getChildBlock('grid.columnSet')->getFilterVisibility()): ?>
34+
<?php if ($block->getPagerVisibility() || $block->getExportTypes() || $block->getChildBlock('grid.columnSet')->getFilterVisibility() || $massActionAvailable): ?>
3535
<div class="admin__data-grid-header-row">
3636
<?php if ($massActionAvailable): ?>
3737
<?php echo $block->getMainButtonsHtml() ? '<div class="admin__filter-actions">' . $block->getMainButtonsHtml() . '</div>' : ''; ?>

app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ $numColumns = sizeof($block->getColumns());
3030
<?php else: ?>
3131
<?php echo $block->getLayout()->getMessagesBlock()->getGroupedHtml() ?>
3232
<?php endif; ?>
33-
<?php if ($block->getPagerVisibility() || $block->getExportTypes() || $block->getFilterVisibility()): ?>
34-
<?php $massActionAvailable = $block->getMassactionBlock() && $block->getMassactionBlock()->isAvailable() ?>
33+
<?php $massActionAvailable = $block->getMassactionBlock() && $block->getMassactionBlock()->isAvailable() ?>
34+
<?php if ($block->getPagerVisibility() || $block->getExportTypes() || $block->getFilterVisibility() || $massActionAvailable): ?>
3535
<div class="admin__data-grid-header admin__data-grid-toolbar">
3636
<div class="admin__data-grid-header-row">
3737
<?php if ($massActionAvailable): ?>

app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
</item>
179179
<!-- Value of region_id field is filtered by the value of county_id attribute -->
180180
<item name="filterBy" xsi:type="array">
181-
<item name="target" xsi:type="string"><![CDATA[<%= provider %>:<%= parentScope %>.country_id]]></item>
181+
<item name="target" xsi:type="string">${ $.provider }:${ $.parentScope }.country_id</item>
182182
<item name="field" xsi:type="string">country_id</item>
183183
</item>
184184
</item>

app/code/Magento/Checkout/view/frontend/templates/cart/form.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<div class="cart main actions">
3939
<?php if ($block->getContinueShoppingUrl()): ?>
4040
<a class="action continue"
41-
href="<?php echo $block->getContinueShoppingUrl() ?>"
41+
href="<?php echo $block->escapeUrl($block->getContinueShoppingUrl()) ?>"
4242
title="<?php echo $block->escapeHtml(__('Continue Shopping')); ?>">
4343
<span><?php echo __('Continue Shopping') ?></span>
4444
</a>

app/code/Magento/Checkout/view/frontend/templates/cart/noItems.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<div class="cart-empty">
1010
<?php echo $block->getChildHtml('checkout_cart_empty_widget'); ?>
1111
<p><?php echo __('You have no items in your shopping cart.') ?></p>
12-
<p><?php echo __('Click <a href="%1">here</a> to continue shopping.', $block->getContinueShoppingUrl()) ?></p>
12+
<p><?php echo __('Click <a href="%1">here</a> to continue shopping.',
13+
$block->escapeUrl($block->getContinueShoppingUrl())) ?></p>
1314
<?php echo $block->getChildHtml('shopping.cart.table.after'); ?>
1415
</div>

app/code/Magento/Checkout/view/frontend/templates/onepage/failure.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
?>
1010
<?php if ($block->getRealOrderId()) : ?><p><?php echo __('Order #') . $block->getRealOrderId() ?></p><?php endif ?>
1111
<?php if ($error = $block->getErrorMessage()) : ?><p><?php echo $error ?></p><?php endif ?>
12-
<p><?php echo __('Click <a href="%1">here</a> to continue shopping.', $block->getContinueShoppingUrl()) ?></p>
12+
<p><?php echo __('Click <a href="%1">here</a> to continue shopping.', $block->escapeUrl($block->getContinueShoppingUrl())) ?></p>

app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,13 @@ protected function _addShippingItem($quoteItemId, $data)
464464
$qty = isset($data['qty']) ? (int)$data['qty'] : 1;
465465
//$qty = $qty > 0 ? $qty : 1;
466466
$addressId = isset($data['address']) ? $data['address'] : false;
467-
468-
if (!$this->isAddressIdApplicable($addressId)) {
469-
throw new LocalizedException(__('Please check shipping address information.'));
470-
}
471-
472467
$quoteItem = $this->getQuote()->getItemById($quoteItemId);
473468

474469
if ($addressId && $quoteItem) {
470+
if (!$this->isAddressIdApplicable($addressId)) {
471+
throw new LocalizedException(__('Please check shipping address information.'));
472+
}
473+
475474
/**
476475
* Skip item processing if qty 0
477476
*/

app/code/Magento/Multishipping/Test/Unit/Model/Checkout/Type/MultishippingTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,11 @@ public function testSetShippingItemsInformation()
133133
]
134134
]
135135
];
136-
$customerAddressId = 42;
137-
138-
$customerAddressMock = $this->getMock('\Magento\Customer\Model\Data\Address', [], [], '', false);
139-
$customerAddressMock->expects($this->atLeastOnce())->method('getId')->willReturn($customerAddressId);
140-
$customerAddresses = [$customerAddressMock];
141-
142136
$this->quoteMock->expects($this->once())->method('getAllShippingAddresses')->willReturn([]);
143137
$this->checkoutSessionMock->expects($this->any())->method('getQuote')->willReturn($this->quoteMock);
144138

145139
$this->helperMock->expects($this->once())->method('getMaximumQty')->willReturn(500);
146140

147-
$this->customerMock->expects($this->once())->method('getAddresses')->willReturn($customerAddresses);
148141
$this->quoteMock->expects($this->once())->method('getItemById')->with(array_keys($info[0])[0])
149142
->willReturn(null);
150143

@@ -189,7 +182,10 @@ public function testSetShippingItemsInformationForAddressLeak()
189182
$customerAddressMock->expects($this->atLeastOnce())->method('getId')->willReturn($customerAddressId);
190183
$customerAddresses = [$customerAddressMock];
191184

185+
$quoteItemMock = $this->getMock('\Magento\Quote\Model\Quote\Item', [], [], '', false);
186+
$this->quoteMock->expects($this->once())->method('getItemById')->willReturn($quoteItemMock);
192187
$this->quoteMock->expects($this->once())->method('getAllShippingAddresses')->willReturn([]);
188+
193189
$this->checkoutSessionMock->expects($this->any())->method('getQuote')->willReturn($this->quoteMock);
194190
$this->helperMock->expects($this->once())->method('getMaximumQty')->willReturn(500);
195191
$this->customerMock->expects($this->once())->method('getAddresses')->willReturn($customerAddresses);

dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Block/Multishipping/MultishippingAgreementReview.php

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,70 @@
33
* Copyright © 2015 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\CheckoutAgreements\Test\Block\Multishipping;
78

8-
use Magento\CheckoutAgreements\Test\Block\Onepage\AgreementReview;
9+
use \Magento\Multishipping\Test\Block\Checkout\Overview;
10+
use Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement;
11+
use Magento\Mtf\Client\Locator;
912

1013
/**
11-
* Multiple addresses checkout order review block.
14+
* Class MultishippingAgreementReview
15+
* Multiple page checkout order review block
1216
*/
13-
class MultishippingAgreementReview extends AgreementReview
17+
class MultishippingAgreementReview extends Overview
1418
{
15-
//
19+
/**
20+
* Notification agreements locator
21+
*
22+
* @var string
23+
*/
24+
protected $notification = 'div.mage-error';
25+
26+
/**
27+
* Agreement locator
28+
*
29+
* @var string
30+
*/
31+
protected $agreement = './/div[contains(@id, "checkout-review-submit")]//label[.="%s"]';
32+
33+
/**
34+
* Agreement checkbox locator
35+
*
36+
* @var string
37+
*/
38+
protected $agreementCheckbox = 'input[name^=agreement]';
39+
40+
/**
41+
* Get notification massage
42+
*
43+
* @return string
44+
*/
45+
public function getNotificationMassage()
46+
{
47+
return $this->_rootElement->find($this->notification)->getText();
48+
}
49+
50+
/**
51+
* Set agreement
52+
*
53+
* @param string $value
54+
* @return void
55+
*/
56+
public function setAgreement($value)
57+
{
58+
$this->_rootElement->find($this->agreementCheckbox, Locator::SELECTOR_CSS, 'checkbox')->setValue($value);
59+
}
60+
61+
/**
62+
* Check agreement
63+
*
64+
* @param CheckoutAgreement $agreement
65+
* @return bool
66+
*/
67+
public function checkAgreement(CheckoutAgreement $agreement)
68+
{
69+
return $this->_rootElement
70+
->find(sprintf($this->agreement, $agreement->getCheckboxText()), Locator::SELECTOR_XPATH)->isVisible();
71+
}
1672
}

0 commit comments

Comments
 (0)