Skip to content

Commit 44e90c4

Browse files
committed
Merge pull request #137 from magento-south/BUGS
[South] Sprint 32: Bug fixes
2 parents a72c664 + a484482 commit 44e90c4

File tree

38 files changed

+1302
-220
lines changed

38 files changed

+1302
-220
lines changed

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@
179179
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
180180
<comment>Warning! Enabling this feature is not recommended on production environments because it represents a potential security risk.</comment>
181181
</field>
182+
<field id="minify_html" translate="label" type="select" sortOrder="25" showInDefault="1" showInWebsite="1" showInStore="1">
183+
<label>Minify Html</label>
184+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
185+
</field>
182186
</group>
183187
<group id="translate_inline" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
184188
<label>Translate Inline</label>

app/code/Magento/Backend/etc/config.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd">
99
<default>
10+
<dev>
11+
<template>
12+
<minify_html>1</minify_html>
13+
</template>
14+
</dev>
1015
<system>
1116
<media_storage_configuration>
1217
<allowed_resources>

app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/checkbox.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
echo 'validate-one-required-by-name' ?>"
3131
id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"
3232
type="checkbox"
33-
name="bundle_option[<?php echo $_option->getId() ?>][]"<?php if ($block->isSelected($_selection)) {
33+
name="bundle_option[<?php echo $_option->getId() ?>][<?php echo $_selection ?>]"<?php if ($block->isSelected($_selection)) {
3434
echo ' checked="checked"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) {
3535
echo ' disabled="disabled"' ?>
3636
value="<?php echo $_selection->getSelectionId() ?>"

app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/multi.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
price="<?php echo $block->getSelectionPrice($_selections[0]) ?>" />
2222
<?php else: ?>
2323
<select multiple="multiple" size="5" id="bundle-option-<?php echo $_option->getId() ?>"
24-
name="bundle_option[<?php echo $_option->getId() ?>][]"
24+
name="bundle_option[<?php echo $_option->getId() ?>]"
2525
class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> multiselect change-container-classname"
2626
onchange="ProductConfigure.bundleControl.changeSelection(this)">
2727
<?php if(!$_option->getRequired()): ?>

app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/type/bundle/option/checkbox.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"
3131
type="checkbox"
3232
<?php if ($_option->getRequired()) echo 'data-validate="{\'validate-one-required-by-name\':true}"'?>
33-
name="bundle_option[<?php echo $_option->getId() ?>][]"
33+
name="bundle_option[<?php echo $_option->getId() ?>][<?php echo $_selection->getId() ?>]"
3434
<?php if ($block->isSelected($_selection)) echo ' checked="checked"' ?>
3535
<?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?>
3636
value="<?php echo $_selection->getSelectionId() ?>"/>

app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/type/bundle/option/multi.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<select multiple="multiple"
2525
size="5"
2626
id="bundle-option-<?php echo $_option->getId() ?>"
27-
name="bundle_option[<?php echo $_option->getId() ?>][]"
27+
name="bundle_option[<?php echo $_option->getId() ?>]"
2828
class="bundle-option-<?php echo $_option->getId() ?> multiselect product bundle option change-container-classname"
2929
<?php if ($_option->getRequired()) echo 'data-validate={required:true}' ?>>
3030
<?php if(!$_option->getRequired()): ?>

app/code/Magento/Catalog/view/base/templates/product/price/amount/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<?php if ($block->getDisplayLabel()): ?>
1616
<span class="price-label"><?php echo $block->getDisplayLabel(); ?></span>
1717
<?php endif; ?>
18-
<span<?php if ($block->getPriceId()): ?> id="<?php echo $block->getPriceId() ?>"<?php endif;?>
18+
<span <?php if ($block->getPriceId()): ?> id="<?php echo $block->getPriceId() ?>"<?php endif;?>
1919
<?php echo($block->getPriceDisplayLabel()) ? 'data-label="' . $block->getPriceDisplayLabel() . $block->getPriceDisplayInclExclTaxes() . '"' : '' ?>
2020
data-price-amount="<?php echo $block->getDisplayValue(); ?>"
2121
data-price-type="<?php echo $block->getPriceType(); ?>"

app/code/Magento/Checkout/Helper/Data.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,11 @@ public function sendPaymentFailedEmail($checkout, $message, $checkoutType = 'one
278278
[
279279
'reason' => $message,
280280
'checkoutType' => $checkoutType,
281-
'dateAndTime' => $this->_localeDate->date(),
281+
'dateAndTime' => $this->_localeDate->formatDateTime(
282+
new \DateTime(),
283+
\IntlDateFormatter::MEDIUM,
284+
\IntlDateFormatter::MEDIUM
285+
),
282286
'customer' => $checkout->getCustomerFirstname() . ' ' . $checkout->getCustomerLastname(),
283287
'customerEmail' => $checkout->getCustomerEmail(),
284288
'billingAddress' => $checkout->getBillingAddress(),

app/code/Magento/Checkout/Test/Unit/Helper/DataTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ protected function setUp()
123123
);
124124

125125
$this->_checkoutSession = $arguments['checkoutSession'];
126-
$localeDate = $arguments['localeDate'];
127-
$localeDate->expects($this->any())->method('date')->will($this->returnValue('Oct 02, 2013'));
126+
$arguments['localeDate']->expects($this->any())
127+
->method('formatDateTime')
128+
->willReturn('Oct 02, 2013');
128129

129130
$this->_transportBuilder = $arguments['transportBuilder'];
130131

app/code/Magento/Customer/Controller/Account/CreatePost.php

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?php
22
/**
3-
*
43
* Copyright © 2015 Magento. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76
namespace Magento\Customer\Controller\Account;
87

8+
use Magento\Customer\Model\Account\Redirect as AccountRedirect;
99
use Magento\Customer\Api\Data\AddressInterface;
1010
use Magento\Customer\Model\Url;
11+
use Magento\Framework\Api\DataObjectHelper;
1112
use Magento\Framework\App\Action\Context;
1213
use Magento\Customer\Model\Session;
1314
use Magento\Framework\Controller\Result\RedirectFactory;
@@ -28,19 +29,12 @@
2829
use Magento\Customer\Model\CustomerExtractor;
2930
use Magento\Framework\Exception\StateException;
3031
use Magento\Framework\Exception\InputException;
31-
use Magento\Store\Model\ScopeInterface;
3232

3333
/**
3434
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3535
*/
3636
class CreatePost extends \Magento\Customer\Controller\Account
3737
{
38-
/** @var ScopeConfigInterface */
39-
protected $scopeConfig;
40-
41-
/** @var StoreManagerInterface */
42-
protected $storeManager;
43-
4438
/** @var AccountManagementInterface */
4539
protected $accountManagement;
4640

@@ -77,10 +71,13 @@ class CreatePost extends \Magento\Customer\Controller\Account
7771
/** @var \Magento\Framework\UrlInterface */
7872
protected $urlModel;
7973

74+
/** @var DataObjectHelper */
75+
protected $dataObjectHelper;
76+
8077
/**
81-
* @var \Magento\Framework\Api\DataObjectHelper
78+
* @var AccountRedirect
8279
*/
83-
protected $dataObjectHelper;
80+
private $accountRedirect;
8481

8582
/**
8683
* @param Context $context
@@ -101,7 +98,8 @@ class CreatePost extends \Magento\Customer\Controller\Account
10198
* @param Registration $registration
10299
* @param Escaper $escaper
103100
* @param CustomerExtractor $customerExtractor
104-
* @param \Magento\Framework\Api\DataObjectHelper $dataObjectHelper
101+
* @param DataObjectHelper $dataObjectHelper
102+
* @param AccountRedirect $accountRedirect
105103
*
106104
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
107105
*/
@@ -124,7 +122,8 @@ public function __construct(
124122
Registration $registration,
125123
Escaper $escaper,
126124
CustomerExtractor $customerExtractor,
127-
\Magento\Framework\Api\DataObjectHelper $dataObjectHelper
125+
DataObjectHelper $dataObjectHelper,
126+
AccountRedirect $accountRedirect
128127
) {
129128
$this->scopeConfig = $scopeConfig;
130129
$this->storeManager = $storeManager;
@@ -141,7 +140,13 @@ public function __construct(
141140
$this->customerExtractor = $customerExtractor;
142141
$this->urlModel = $urlFactory->create();
143142
$this->dataObjectHelper = $dataObjectHelper;
144-
parent::__construct($context, $customerSession, $resultRedirectFactory, $resultPageFactory);
143+
$this->accountRedirect = $accountRedirect;
144+
parent::__construct(
145+
$context,
146+
$customerSession,
147+
$resultRedirectFactory,
148+
$resultPageFactory
149+
);
145150
}
146151

147152
/**
@@ -257,9 +262,8 @@ public function execute()
257262
$resultRedirect->setUrl($this->_redirect->success($url));
258263
} else {
259264
$this->_getSession()->setCustomerDataAsLoggedIn($customer);
260-
261265
$this->messageManager->addSuccess($this->getSuccessMessage());
262-
$resultRedirect->setUrl($this->getSuccessRedirect());
266+
$resultRedirect = $this->accountRedirect->getRedirect();
263267
}
264268
return $resultRedirect;
265269
} catch (StateException $e) {
@@ -329,23 +333,4 @@ protected function getSuccessMessage()
329333
}
330334
return $message;
331335
}
332-
333-
/**
334-
* Retrieve success redirect URL
335-
*
336-
* @return string
337-
*/
338-
protected function getSuccessRedirect()
339-
{
340-
$redirectToDashboard = $this->scopeConfig->isSetFlag(
341-
Url::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD,
342-
ScopeInterface::SCOPE_STORE
343-
);
344-
if (!$redirectToDashboard && $this->_getSession()->getBeforeAuthUrl()) {
345-
$successUrl = $this->_getSession()->getBeforeAuthUrl(true);
346-
} else {
347-
$successUrl = $this->urlModel->getUrl('*/*/index', ['_secure' => true]);
348-
}
349-
return $this->_redirect->success($successUrl);
350-
}
351336
}

0 commit comments

Comments
 (0)