Skip to content

Commit 4f08d3a

Browse files
author
Maksym Aposov
committed
Merge branch 'mainline_develop' into S73
2 parents 427f014 + fc2de56 commit 4f08d3a

File tree

255 files changed

+6648
-2859
lines changed

Some content is hidden

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

255 files changed

+6648
-2859
lines changed

app/code/Magento/Authorizenet/view/frontend/web/template/payment/authorizenet-directpost.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"
6262
class="action primary checkout"
6363
disabled>
64-
<span data-bind="text: $t('Place Order')"></span>
64+
<span data-bind="i18n: 'Place Order'"></span>
6565
</button>
6666
</div>
6767
</div>

app/code/Magento/Backend/Model/Url.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ protected function _setRouteParams(array $data, $unsetOldParams = true)
181181
*/
182182
public function getUrl($routePath = null, $routeParams = null)
183183
{
184+
if (filter_var($routePath, FILTER_VALIDATE_URL)) {
185+
return $routePath;
186+
}
187+
184188
$cacheSecretKey = false;
185189
if (is_array($routeParams) && isset($routeParams['_cache_secret_key'])) {
186190
unset($routeParams['_cache_secret_key']);
@@ -190,6 +194,7 @@ public function getUrl($routePath = null, $routeParams = null)
190194
if (!$this->useSecretKey()) {
191195
return $result;
192196
}
197+
$this->_setRoutePath($routePath);
193198
$routeName = $this->_getRouteName('*');
194199
$controllerName = $this->_getControllerName(self::DEFAULT_CONTROLLER_NAME);
195200
$actionName = $this->_getActionName(self::DEFAULT_ACTION_NAME);

app/code/Magento/Backend/Test/Unit/Model/UrlTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,4 +407,10 @@ public function testGetSecretKeyGenerationWithRouteNameInForwardInfo()
407407
$keyFromRequest = $this->_model->getSecretKey();
408408
$this->assertEquals($keyFromParams, $keyFromRequest);
409409
}
410+
411+
public function testGetUrlWithUrlInRoutePath()
412+
{
413+
$routePath = 'https://localhost/index.php/catalog/product/view/id/100/?foo=bar#anchor';
414+
static::assertEquals($routePath, $this->_model->getUrl($routePath));
415+
}
410416
}

app/code/Magento/Backend/view/adminhtml/layout/default.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
</referenceContainer>
7070
<referenceContainer name="after.body.start">
7171
<block class="Magento\RequireJs\Block\Html\Head\Config" name="requirejs-config"/>
72+
<block class="Magento\Translation\Block\Html\Head\Config" name="translate-config"/>
7273
<block class="Magento\Translation\Block\Js" name="translate" template="Magento_Translation::translate.phtml"/>
7374
<block class="Magento\Framework\View\Element\Js\Components" name="head.components" as="components" template="Magento_Backend::page/js/components.phtml"/>
7475
<block class="Magento\Framework\View\Element\Html\Calendar" name="head.calendar" as="calendar" template="Magento_Backend::page/js/calendar.phtml"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"
4242
class="action primary checkout"
4343
disabled>
44-
<span data-bind="text: $t('Place Order')"></span>
44+
<span data-bind="i18n: 'Place Order'"></span>
4545
</button>
4646
</div>
4747
</div>

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636

3737
<fieldset data-bind="attr: {class: 'fieldset payment items ccard ' + getCode(), id: 'braintree_form_cc'}">
3838
<!-- ko if: (isShowLegend())-->
39-
<legend class="legend"><span><!-- ko text: $t('Credit Card Information')--><!-- /ko --></span></legend><br />
39+
<legend class="legend"><span><!-- ko i18n: 'Credit Card Information'--><!-- /ko --></span></legend><br />
4040
<!-- /ko -->
4141
<!-- ko if: (useVault()) -->
4242
<div>
4343
<label data-bind="attr: {for: getCode() + '_cc_token'}" class="label">
44-
<span><!-- ko text: $t('Payment Information')--><!-- /ko --></span>
44+
<span><!-- ko i18n: 'Payment Information'--><!-- /ko --></span>
4545
</label>
4646
<div class="control">
4747
<select name="payment[cc_token]" class="select"
@@ -60,7 +60,7 @@
6060
<!-- /ko -->
6161
<div class="field type required" data-bind="visible: isCcFormShown">
6262
<label data-bind="attr: {for: getCode() + '_cc_type'}" class="label">
63-
<span><!-- ko text: $t('Credit Card Type')--><!-- /ko --></span>
63+
<span><!-- ko i18n: 'Credit Card Type'--><!-- /ko --></span>
6464
</label>
6565
<div class="control">
6666
<!-- ko if: (!isCcDetectionEnabled())-->
@@ -102,7 +102,7 @@
102102
</div>
103103
<div class="field number required" data-bind="visible: isCcFormShown">
104104
<label data-bind="attr: {for: getCode() + '_cc_number'}" class="label">
105-
<span><!-- ko text: $t('Credit Card Number')--><!-- /ko --></span>
105+
<span><!-- ko i18n: 'Credit Card Number'--><!-- /ko --></span>
106106
</label>
107107
<div class="control">
108108
<input type="number" name="payment[cc_number]" class="input-text" value=""
@@ -112,7 +112,7 @@
112112
</div>
113113
<div class="field date required" data-bind="attr: {id: getCode() + '_cc_type_exp_div'}, visible: isCcFormShown">
114114
<label data-bind="attr: {for: getCode() + '_expiration'}" class="label">
115-
<span><!-- ko text: $t('Expiration Date')--><!-- /ko --></span>
115+
<span><!-- ko i18n: 'Expiration Date'--><!-- /ko --></span>
116116
</label>
117117
<div class="control">
118118
<div class="fields group group-2">
@@ -148,7 +148,7 @@
148148
<!-- ko if: (hasVerification())-->
149149
<div class="field cvv required" data-bind="attr: {id: getCode() + '_cc_type_cvv_div'}, visible: isCcFormShown">
150150
<label data-bind="attr: {for: getCode() + '_cc_cid'}" class="label">
151-
<span><!-- ko text: $t('Card Verification Number')--><!-- /ko --></span>
151+
<span><!-- ko i18n: 'Card Verification Number'--><!-- /ko --></span>
152152
</label>
153153
<div class="control">
154154
<input type="number"
@@ -166,7 +166,7 @@
166166
tabindex="0"
167167
data-toggle="dropdown"
168168
data-bind="attr: {title: $t('What is this?')}, mageInit: {'dropdown':{'activeClass': '_active'}}">
169-
<span><!-- ko text: $t('What is this?')--><!-- /ko --></span>
169+
<span><!-- ko i18n: 'What is this?'--><!-- /ko --></span>
170170
</span>
171171
<div class="field-tooltip-content"
172172
data-target="dropdown"
@@ -189,7 +189,7 @@
189189
class="checkbox"
190190
data-bind="checked: storeInVault"/>
191191
<label class="label" for="braintree_store_in_vault">
192-
<span><!-- ko text: $t('Save this card for future use')--><!-- /ko --></span>
192+
<span><!-- ko i18n: 'Save this card for future use'--><!-- /ko --></span>
193193
</label>
194194
</div>
195195
</div>
@@ -212,7 +212,7 @@
212212
css: {disabled: !isPlaceOrderActionAllowed()}
213213
"
214214
disabled>
215-
<span data-bind="text: $t('Place Order')"></span>
215+
<span data-bind="i18n: 'Place Order'"></span>
216216
</button>
217217
</div>
218218
</div>

app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Renderer extends \Magento\Checkout\Block\Cart\Item\Renderer
2626
* @param \Magento\Framework\View\Element\Template\Context $context
2727
* @param \Magento\Catalog\Helper\Product\Configuration $productConfig
2828
* @param \Magento\Checkout\Model\Session $checkoutSession
29-
* @param \Magento\Catalog\Helper\Image $imageHelper
29+
* @param \Magento\Catalog\Helper\Image $imageBuilder
3030
* @param \Magento\Framework\Url\Helper\Data $urlHelper
3131
* @param \Magento\Framework\Message\ManagerInterface $messageManager
3232
* @param PriceCurrencyInterface $priceCurrency
@@ -39,7 +39,7 @@ public function __construct(
3939
\Magento\Framework\View\Element\Template\Context $context,
4040
\Magento\Catalog\Helper\Product\Configuration $productConfig,
4141
\Magento\Checkout\Model\Session $checkoutSession,
42-
\Magento\Catalog\Helper\Image $imageHelper,
42+
\Magento\Catalog\Block\Product\ImageBuilder $imageBuilder,
4343
\Magento\Framework\Url\Helper\Data $urlHelper,
4444
\Magento\Framework\Message\ManagerInterface $messageManager,
4545
PriceCurrencyInterface $priceCurrency,
@@ -52,7 +52,7 @@ public function __construct(
5252
$context,
5353
$productConfig,
5454
$checkoutSession,
55-
$imageHelper,
55+
$imageBuilder,
5656
$urlHelper,
5757
$messageManager,
5858
$priceCurrency,

app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</div>
2121
<div class="content">
2222
<div class="bundle-info">
23-
<?php echo $block->getLayout()->createBlock('Magento\Catalog\Block\Product\Image')->init($_product, 'bundled_product_customization_page')->toHtml() ?>
23+
<?php echo $block->getImage($_product, 'bundled_product_customization_page')->toHtml(); ?>
2424
<div class="product-details">
2525
<strong class="product name"><?php echo $block->escapeHtml($_product->getName()) ?></strong>
2626
<?php if ($_product->getIsSalable()): ?>

app/code/Magento/Captcha/view/frontend/web/template/checkout/captcha.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
-->
77
<!-- ko if: (isRequired() && getIsVisible())-->
88
<div class="field captcha required" data-bind="blockLoader: getIsLoading()">
9-
<label data-bind="attr: {for: 'captcha_' + formId}" class="label"><span data-bind="text: $t('Please type the letters below')"></span></label>
9+
<label data-bind="attr: {for: 'captcha_' + formId}" class="label"><span data-bind="i18n: 'Please type the letters below'"></span></label>
1010
<div class="control captcha">
1111
<input name="captcha_string" type="text" class="input-text required-entry" data-bind="value: captchaValue(), attr: {id: 'captcha_' + formId, 'data-scope': dataScope}" />
1212
<input name="captcha_form_id" type="hidden" data-bind="value: formId, attr: {'data-scope': dataScope}" />
@@ -20,12 +20,12 @@
2020
}"
2121
class="captcha-img"/>
2222
<button type="button" class="action reload captcha-reload" data-bind="attr: {title: $t('Reload captcha')}, click: refresh">
23-
<span data-bind="text: $t('Reload captcha')"></span>
23+
<span data-bind="i18n: 'Reload captcha'"></span>
2424
</button>
2525
</div>
2626
</div>
2727
<!-- ko if: isCaseSensitive()-->
28-
<div class="captcha-note note" data-bind="text: $t('Attention: Captcha is case sensitive.')"></div>
28+
<div class="captcha-note note" data-bind="i18n: 'Attention: Captcha is case sensitive.'"></div>
2929
<!-- /ko -->
3030
</div>
3131
</div>

app/code/Magento/Catalog/Block/Product/AbstractProduct.php

Lines changed: 17 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class AbstractProduct extends \Magento\Framework\View\Element\Template
101101
public function __construct(\Magento\Catalog\Block\Product\Context $context, array $data = [])
102102
{
103103
$this->_imageHelper = $context->getImageHelper();
104+
$this->imageBuilder = $context->getImageBuilder();
104105
$this->_compareProduct = $context->getCompareProduct();
105106
$this->_wishlistHelper = $context->getWishlistHelper();
106107
$this->_cartHelper = $context->getCartHelper();
@@ -241,28 +242,6 @@ protected function _addProductAttributesAndPrices(\Magento\Catalog\Model\Resourc
241242
->addUrlRewrite();
242243
}
243244

244-
/**
245-
* Retrieve given media attribute label or product name if no label
246-
*
247-
* @param \Magento\Catalog\Model\Product $product
248-
* @param string $mediaAttributeCode
249-
*
250-
* @return string
251-
*/
252-
public function getImageLabel($product = null, $mediaAttributeCode = 'image')
253-
{
254-
if ($product === null) {
255-
$product = $this->getProduct();
256-
}
257-
258-
$label = $product->getData($mediaAttributeCode . '_label');
259-
if (empty($label)) {
260-
$label = $product->getName();
261-
}
262-
263-
return $label;
264-
}
265-
266245
/**
267246
* Retrieve Product URL using UrlDataObject
268247
*
@@ -398,138 +377,6 @@ public function displayProductStockStatus()
398377
return (bool) $statusInfo->getDisplayStatus();
399378
}
400379

401-
/**
402-
* Product thumbnail image url getter
403-
*
404-
* @param \Magento\Catalog\Model\Product $product
405-
* @return string
406-
*/
407-
public function getThumbnailUrl($product)
408-
{
409-
return (string) $this->_imageHelper->init($product, 'thumbnail')
410-
->resize($this->getThumbnailSize());
411-
}
412-
413-
/**
414-
* Thumbnail image size getter
415-
*
416-
* @return int
417-
*/
418-
public function getThumbnailSize()
419-
{
420-
return $this->getVar('product_thumbnail_image_size', 'Magento_Catalog');
421-
}
422-
423-
/**
424-
* Product thumbnail image sidebar url getter
425-
*
426-
* @param \Magento\Catalog\Model\Product $product
427-
* @return string
428-
*/
429-
public function getThumbnailSidebarUrl($product)
430-
{
431-
return (string) $this->_imageHelper->init($product, 'thumbnail')
432-
->resize($this->getThumbnailSidebarSize());
433-
}
434-
435-
/**
436-
* Thumbnail image sidebar size getter
437-
*
438-
* @return int
439-
*/
440-
public function getThumbnailSidebarSize()
441-
{
442-
return $this->getVar('product_thumbnail_image_sidebar_size', 'Magento_Catalog');
443-
}
444-
445-
/**
446-
* Product small image url getter
447-
*
448-
* @param \Magento\Catalog\Model\Product $product
449-
* @return string
450-
*/
451-
public function getSmallImageUrl($product)
452-
{
453-
return (string) $this->_imageHelper->init($product, 'small_image')
454-
->resize($this->getSmallImageSize());
455-
}
456-
457-
/**
458-
* Small image size getter
459-
*
460-
* @return int
461-
*/
462-
public function getSmallImageSize()
463-
{
464-
return $this->getVar('product_small_image_size', 'Magento_Catalog');
465-
}
466-
467-
/**
468-
* Product small image sidebar url getter
469-
*
470-
* @param \Magento\Catalog\Model\Product $product
471-
* @return string
472-
*/
473-
public function getSmallImageSidebarUrl($product)
474-
{
475-
return (string) $this->_imageHelper->init($product, 'small_image')
476-
->resize($this->getSmallImageSidebarSize());
477-
}
478-
479-
/**
480-
* Small image sidebar size getter
481-
*
482-
* @return int
483-
*/
484-
public function getSmallImageSidebarSize()
485-
{
486-
return $this->getVar('product_small_image_sidebar_size', 'Magento_Catalog');
487-
}
488-
489-
/**
490-
* Product base image url getter
491-
*
492-
* @param \Magento\Catalog\Model\Product $product
493-
* @return string
494-
*/
495-
public function getBaseImageUrl($product)
496-
{
497-
return (string) $this->_imageHelper->init($product, 'image')
498-
->resize($this->getBaseImageSize());
499-
}
500-
501-
/**
502-
* Base image size getter
503-
*
504-
* @return int
505-
*/
506-
public function getBaseImageSize()
507-
{
508-
return $this->getVar('product_base_image_size', 'Magento_Catalog');
509-
}
510-
511-
/**
512-
* Product base image icon url getter
513-
*
514-
* @param \Magento\Catalog\Model\Product $product
515-
* @return string
516-
*/
517-
public function getBaseImageIconUrl($product)
518-
{
519-
return (string) $this->_imageHelper->init($product, 'image')
520-
->resize($this->getBaseImageIconSize());
521-
}
522-
523-
/**
524-
* Base image icon size getter
525-
*
526-
* @return int
527-
*/
528-
public function getBaseImageIconSize()
529-
{
530-
return $this->getVar('product_base_image_icon_size', 'Magento_Catalog');
531-
}
532-
533380
/**
534381
* Get random string
535382
*
@@ -642,4 +489,20 @@ protected function getDetailsRendererList()
642489
'details.renderers'
643490
);
644491
}
492+
493+
/**
494+
* Retrieve product image
495+
*
496+
* @param \Magento\Catalog\Model\Product $product
497+
* @param string $imageId
498+
* @param array $attributes
499+
* @return \Magento\Catalog\Block\Product\Image
500+
*/
501+
public function getImage($product, $imageId, $attributes = [])
502+
{
503+
return $this->imageBuilder->setProduct($product)
504+
->setImageId($imageId)
505+
->setAttributes($attributes)
506+
->create();
507+
}
645508
}

0 commit comments

Comments
 (0)