Skip to content

Commit 54c5aad

Browse files
author
Igor Melnikov
committed
MAGETWO-67871: Requesting autogenerated classes that are not in constructor cause fatal errors in production mode
- merge with remote branch, conflicts: app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php
2 parents 49b0d16 + 1432268 commit 54c5aad

File tree

76 files changed

+1617
-219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1617
-219
lines changed

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ addons:
77
- mysql-client-core-5.6
88
- mysql-client-5.6
99
- postfix
10+
firefox: "46.0"
11+
hosts:
12+
- magento2.travis
1013
language: php
1114
php:
1215
- 7.0
@@ -16,19 +19,26 @@ env:
1619
- COMPOSER_BIN_DIR=~/bin
1720
- INTEGRATION_SETS=3
1821
- NODE_JS_VERSION=6
22+
- MAGENTO_HOST_NAME="magento2.travis"
1923
matrix:
2024
- TEST_SUITE=unit
2125
- TEST_SUITE=integration INTEGRATION_INDEX=1
2226
- TEST_SUITE=integration INTEGRATION_INDEX=2
2327
- TEST_SUITE=integration INTEGRATION_INDEX=3
2428
- TEST_SUITE=static
2529
- TEST_SUITE=js
30+
- TEST_SUITE=functional ACCEPTANCE_INDEX=1
31+
- TEST_SUITE=functional ACCEPTANCE_INDEX=2
2632
matrix:
2733
exclude:
2834
- php: 7.0
2935
env: TEST_SUITE=static
3036
- php: 7.0
3137
env: TEST_SUITE=js
38+
- php: 7.0
39+
env: TEST_SUITE=functional ACCEPTANCE_INDEX=1
40+
- php: 7.0
41+
env: TEST_SUITE=functional ACCEPTANCE_INDEX=2
3242
cache:
3343
apt: true
3444
directories:

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ define(
3636
braintreeDeviceData: null,
3737
paymentMethodNonce: null,
3838
lastBillingAddress: null,
39+
ccCode: null,
40+
ccMessageContainer: null,
3941
validatorManager: validatorManager,
4042
code: 'braintree',
4143

@@ -138,9 +140,39 @@ define(
138140
return;
139141
}
140142

143+
this.restoreMessageContainer();
144+
this.restoreCode();
145+
146+
/**
147+
* Define onReady callback
148+
*/
149+
braintree.onReady = function () {};
141150
this.initBraintree();
142151
},
143152

153+
/**
154+
* Restore original message container for cc-form component
155+
*/
156+
restoreMessageContainer: function () {
157+
this.messageContainer = this.ccMessageContainer;
158+
},
159+
160+
/**
161+
* Restore original code for cc-form component
162+
*/
163+
restoreCode: function () {
164+
this.code = this.ccCode;
165+
},
166+
167+
/** @inheritdoc */
168+
initChildren: function () {
169+
this._super();
170+
this.ccMessageContainer = this.messageContainer;
171+
this.ccCode = this.code;
172+
173+
return this;
174+
},
175+
144176
/**
145177
* Init config
146178
*/

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/vault.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ define([
5252
var self = this;
5353

5454
/**
55-
* Define already callback
55+
* Define onReady callback
5656
*/
5757
Braintree.onReady = function () {
5858
self.getPaymentMethodNonce();
@@ -78,6 +78,7 @@ define([
7878
formComponent.setPaymentMethodNonce(response.paymentMethodNonce);
7979
formComponent.additionalData['public_hash'] = self.publicHash;
8080
formComponent.code = self.code;
81+
formComponent.messageContainer = self.messageContainer;
8182
formComponent.placeOrder();
8283
});
8384
})

app/code/Magento/Braintree/view/frontend/web/template/payment/form.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,12 @@
139139
<button class="action primary checkout"
140140
type="submit"
141141
data-bind="
142-
click: placeOrderClick,
143-
attr: {title: $t('Place Order')}
144-
">
142+
click: placeOrderClick,
143+
attr: {title: $t('Place Order')},
144+
css: {disabled: !isPlaceOrderActionAllowed()},
145+
enable: isActive()
146+
"
147+
disabled>
145148
<span data-bind="i18n: 'Place Order'"></span>
146149
</button>
147150
</div>

app/code/Magento/Bundle/Model/Product/SaveHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public function execute($entity, $arguments = [])
6666
$options = $bundleProductOptions ?: [];
6767
foreach ($options as $option) {
6868
$this->optionRepository->save($entity, $option);
69-
$entity->setCopyFromView(false);
7069
}
70+
$entity->setCopyFromView(false);
7171
}
7272
return $entity;
7373
}

app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @api
88
*/
99
define([
10+
'jquery',
1011
'Magento_Ui/js/lib/view/utils/async',
1112
'jquery/ui',
1213
'mage/translate',
@@ -838,4 +839,6 @@ define([
838839
};
839840

840841
productConfigure = new ProductConfigure();
842+
jQuery(document).trigger('productConfigure:inited');
843+
jQuery(document).data('productConfigureInited', true);
841844
});

app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<fieldset class="fieldset rate" data-bind="visible: (shippingRates().length > 0)">
1212
<dl class="items methods" data-bind="foreach: shippingRateGroups">
1313
<dt class="item-title"><span data-bind="text: $data"></span></dt>
14-
<dd class="item-options" data-bind="foreach: $parent.getRatesForGroup($data)">
14+
<dd class="item-options" data-bind="foreach: { data:$parent.getRatesForGroup($data), as: 'method' }">
1515
<div data-bind="css: {'field choice item': available, 'message error': !available} ">
1616
<!-- ko ifnot: (available) -->
1717
<div data-bind="text: error_message"></div>
@@ -29,7 +29,7 @@
2929
"/>
3030
<label class="label" data-bind="attr: {for: 's_method_' + method_code}">
3131
<!-- ko text: $data.method_title --><!-- /ko -->
32-
<!-- ko text: $parents[1].getFormattedPrice(amount) --><!-- /ko -->
32+
<each args="element.getRegion('price')" render="" />
3333
</label>
3434
<!-- /ko -->
3535
</div>

app/code/Magento/Cms/Block/Page.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,26 @@ protected function _prepareLayout()
126126
*/
127127
protected function _addBreadcrumbs(\Magento\Cms\Model\Page $page)
128128
{
129+
$homePageIdentifier = $this->_scopeConfig->getValue(
130+
'web/default/cms_home_page',
131+
ScopeInterface::SCOPE_STORE
132+
);
133+
$homePageDelimiterPosition = strrpos($homePageIdentifier, '|');
134+
if ($homePageDelimiterPosition) {
135+
$homePageIdentifier = substr($homePageIdentifier, 0, $homePageDelimiterPosition);
136+
}
137+
$noRouteIdentifier = $this->_scopeConfig->getValue(
138+
'web/default/cms_no_route',
139+
ScopeInterface::SCOPE_STORE
140+
);
141+
$noRouteDelimiterPosition = strrpos($noRouteIdentifier, '|');
142+
if ($noRouteDelimiterPosition) {
143+
$noRouteIdentifier = substr($noRouteIdentifier, 0, $noRouteDelimiterPosition);
144+
}
129145
if ($this->_scopeConfig->getValue('web/default/show_cms_breadcrumbs', ScopeInterface::SCOPE_STORE)
130146
&& ($breadcrumbsBlock = $this->getLayout()->getBlock('breadcrumbs'))
131-
&& $page->getIdentifier() !== $this->_scopeConfig->getValue(
132-
'web/default/cms_home_page',
133-
ScopeInterface::SCOPE_STORE
134-
)
135-
&& $page->getIdentifier() !== $this->_scopeConfig->getValue(
136-
'web/default/cms_no_route',
137-
ScopeInterface::SCOPE_STORE
138-
)
147+
&& $page->getIdentifier() !== $homePageIdentifier
148+
&& $page->getIdentifier() !== $noRouteIdentifier
139149
) {
140150
$breadcrumbsBlock->addCrumb(
141151
'home',

app/code/Magento/Cookie/Helper/Cookie.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,22 @@ public function __construct(
7070
public function isUserNotAllowSaveCookie()
7171
{
7272
$acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites();
73+
return $this->isCookieRestrictionModeEnabled() &&
74+
empty($acceptedSaveCookiesWebsites[$this->_website->getId()]);
75+
}
76+
77+
/**
78+
* Check if cookie restriction mode is enabled for this store
79+
*
80+
* @return bool
81+
*/
82+
public function isCookieRestrictionModeEnabled()
83+
{
7384
return $this->scopeConfig->getValue(
7485
self::XML_PATH_COOKIE_RESTRICTION,
7586
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
7687
$this->_currentStore
77-
) && empty($acceptedSaveCookiesWebsites[$this->_website->getId()]);
88+
);
7889
}
7990

8091
/**

app/code/Magento/Cookie/view/frontend/templates/html/notices.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/** @var \Magento\Cookie\Block\Html\Notices $block */
1010
?>
11-
<?php if ($this->helper(\Magento\Cookie\Helper\Cookie::class)->isUserNotAllowSaveCookie()): ?>
11+
<?php if ($this->helper(\Magento\Cookie\Helper\Cookie::class)->isCookieRestrictionModeEnabled()): ?>
1212
<div role="alertdialog"
1313
tabindex="-1"
1414
class="message global cookie"

0 commit comments

Comments
 (0)