Skip to content

Commit 84e49c8

Browse files
committed
MAGETWO-85285: 12482: Sitemap image links in MultiStore #935
- Merge Pull Request magento-engcom/magento2ce#935 from RomaKis/magento2:12482 - Merged commits: 1. 8e426fe
2 parents b05a957 + 8e426fe commit 84e49c8

File tree

109 files changed

+2863
-700
lines changed

Some content is hidden

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

109 files changed

+2863
-700
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ To suggest documentation improvements, click [here][4].
3838
| ![reject](http://devdocs.magento.com/common/images/github_reject.png) | The pull request has been rejected and will not be merged into mainline code. Possible reasons can include but are not limited to: issue has already been fixed in another code contribution, or there is an issue with the code contribution. |
3939
| ![bug report](http://devdocs.magento.com/common/images/github_bug.png) | The Magento Team has confirmed that this issue contains the minimum required information to reproduce. |
4040
| ![acknowledged](http://devdocs.magento.com/common/images/gitHub_acknowledged.png) | The Magento Team has validated the issue and an internal ticket has been created. |
41-
| ![acknowledged](http://devdocs.magento.com/common/images/github_inProgress.png) | The internal ticket is currently in progress, fix is scheduled to be delivered. |
42-
| ![acknowledged](http://devdocs.magento.com/common/images/github_needsUpdate.png) | The Magento Team needs additional information from the reporter to properly prioritize and process the issue or pull request. |
41+
| ![in progress](http://devdocs.magento.com/common/images/github_inProgress.png) | The internal ticket is currently in progress, fix is scheduled to be delivered. |
42+
| ![needs update](http://devdocs.magento.com/common/images/github_needsUpdate.png) | The Magento Team needs additional information from the reporter to properly prioritize and process the issue or pull request. |
43+
44+
To learn more about issue gate labels click [here](https://github.com/magento/magento2/wiki/Magento-Issue-Gates)
4345

4446
<h2>Reporting security issues</h2>
4547

app/code/Magento/Analytics/etc/di.xml

+18
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,22 @@
254254
<argument name="responseResolver" xsi:type="object">NotifyDataChangedResponseResolver</argument>
255255
</arguments>
256256
</type>
257+
<type name="Magento\Config\Model\Config\TypePool">
258+
<arguments>
259+
<argument name="sensitive" xsi:type="array">
260+
<item name="analytics/url/signup" xsi:type="string">1</item>
261+
<item name="analytics/url/update" xsi:type="string">1</item>
262+
<item name="analytics/url/bi_essentials" xsi:type="string">1</item>
263+
<item name="analytics/url/otp" xsi:type="string">1</item>
264+
<item name="analytics/url/report" xsi:type="string">1</item>
265+
<item name="analytics/url/notify_data_changed" xsi:type="string">1</item>
266+
<item name="analytics/general/token" xsi:type="string">1</item>
267+
</argument>
268+
<argument name="environment" xsi:type="array">
269+
<item name="crontab/default/jobs/analytics_collect_data/schedule/cron_expr" xsi:type="string">1</item>
270+
<item name="crontab/default/jobs/analytics_update/schedule/cron_expr" xsi:type="string">1</item>
271+
<item name="crontab/default/jobs/analytics_subscribe/schedule/cron_expr" xsi:type="string">1</item>
272+
</argument>
273+
</arguments>
274+
</type>
257275
</config>

app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected function _prepareCollection()
9292
protected function _afterLoadCollection()
9393
{
9494
foreach ($this->getCollection() as $item) {
95-
$item->getCustomer() ?: $item->setCustomer('Guest');
95+
$item->getCustomer() ?: $item->setCustomer($item->getBillingAddress()->getName());
9696
}
9797
return $this;
9898
}

app/code/Magento/Captcha/i18n/en_US.csv

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Always,Always
44
"Incorrect CAPTCHA","Incorrect CAPTCHA"
55
"Incorrect CAPTCHA.","Incorrect CAPTCHA."
66
"The account is locked. Please wait and try again or contact %1.","The account is locked. Please wait and try again or contact %1."
7-
"Please enter the letters from the image","Please enter the letters from the image"
7+
"Please enter the letters and numbers from the image","Please enter the letters and numbers from the image"
88
"<strong>Attention</strong>: Captcha is case sensitive.","<strong>Attention</strong>: Captcha is case sensitive."
99
"Reload captcha","Reload captcha"
10-
"Please type the letters below","Please type the letters below"
10+
"Please type the letters and numbers below","Please type the letters and numbers below"
1111
"Attention: Captcha is case sensitive.","Attention: Captcha is case sensitive."
1212
CAPTCHA,CAPTCHA
1313
"Enable CAPTCHA in Admin","Enable CAPTCHA in Admin"

app/code/Magento/Captcha/view/adminhtml/templates/default.phtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $captcha = $block->getCaptchaModel();
1313
?>
1414
<div class="admin__field _required">
1515
<label for="captcha" class="admin__field-label">
16-
<span><?= $block->escapeHtml(__('Please enter the letters from the image')) ?></span>
16+
<span><?= $block->escapeHtml(__('Please enter the letters and numbers from the image')) ?></span>
1717
</label>
1818
<div class="admin__field-control">
1919
<input

app/code/Magento/Captcha/view/frontend/templates/default.phtml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
$captcha = $block->getCaptchaModel();
1313
?>
1414
<div class="field captcha required" role="<?= $block->escapeHtmlAttr($block->getFormId()) ?>">
15-
<label for="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?= $block->escapeHtml(__('Please type the letters below')) ?></span></label>
15+
<label for="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?= $block->escapeHtml(__('Please type the letters and numbers below')) ?></span></label>
1616
<div class="control captcha">
1717
<input name="<?= $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE) ?>[<?= $block->escapeHtmlAttr($block->getFormId()) ?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" />
1818
<div class="nested">
@@ -23,7 +23,7 @@ $captcha = $block->getCaptchaModel();
2323
"imageLoader": "<?= $block->escapeUrl($block->getViewFileUrl('images/loader-2.gif')) ?>",
2424
"type": "<?= $block->escapeHtmlAttr($block->getFormId()) ?>"}}'>
2525
<div class="control captcha-image">
26-
<img alt="<?= $block->escapeHtmlAttr(__('Please type the letters below')) ?>" class="captcha-img" height="<?= /* @noEscape */ (float) $block->getImgHeight() ?>" src="<?= $block->escapeUrl($captcha->getImgSrc()) ?>"/>
26+
<img alt="<?= $block->escapeHtmlAttr(__('Please type the letters and numbers below')) ?>" class="captcha-img" height="<?= /* @noEscape */ (float) $block->getImgHeight() ?>" src="<?= $block->escapeUrl($captcha->getImgSrc()) ?>"/>
2727
<button type="button" class="action reload captcha-reload" title="<?= $block->escapeHtmlAttr(__('Reload captcha')) ?>"><span><?= $block->escapeHtml(__('Reload captcha')) ?></span></button>
2828
</div>
2929
</div>

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
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="i18n: '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 and numbers 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}" />
1313
<div class="nested">
1414
<div class="field captcha no-label">
1515
<div class="control captcha-image">
1616
<img data-bind="attr: {
17-
alt: $t('Please type the letters below'),
17+
alt: $t('Please type the letters and numbers below'),
1818
height: imageHeight(),
1919
src: getImageSource(),
2020
}"

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

+104-36
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,20 @@
99
use Magento\Catalog\Api\CategoryRepositoryInterface;
1010
use Magento\Catalog\Block\Product\ProductList\Toolbar;
1111
use Magento\Catalog\Model\Category;
12+
use Magento\Catalog\Model\Config;
13+
use Magento\Catalog\Model\Layer;
14+
use Magento\Catalog\Model\Layer\Resolver;
1215
use Magento\Catalog\Model\Product;
1316
use Magento\Catalog\Model\ResourceModel\Product\Collection;
17+
use Magento\Catalog\Pricing\Price\FinalPrice;
1418
use Magento\Eav\Model\Entity\Collection\AbstractCollection;
19+
use Magento\Framework\App\ActionInterface;
20+
use Magento\Framework\App\Config\Element;
21+
use Magento\Framework\Data\Helper\PostHelper;
1522
use Magento\Framework\DataObject\IdentityInterface;
1623
use Magento\Framework\Exception\NoSuchEntityException;
24+
use Magento\Framework\Pricing\Render;
25+
use Magento\Framework\Url\Helper\Data;
1726

1827
/**
1928
* Product list
@@ -40,17 +49,17 @@ class ListProduct extends AbstractProduct implements IdentityInterface
4049
/**
4150
* Catalog layer
4251
*
43-
* @var \Magento\Catalog\Model\Layer
52+
* @var Layer
4453
*/
4554
protected $_catalogLayer;
4655

4756
/**
48-
* @var \Magento\Framework\Data\Helper\PostHelper
57+
* @var PostHelper
4958
*/
5059
protected $_postDataHelper;
5160

5261
/**
53-
* @var \Magento\Framework\Url\Helper\Data
62+
* @var Data
5463
*/
5564
protected $urlHelper;
5665

@@ -61,18 +70,18 @@ class ListProduct extends AbstractProduct implements IdentityInterface
6170

6271
/**
6372
* @param Context $context
64-
* @param \Magento\Framework\Data\Helper\PostHelper $postDataHelper
65-
* @param \Magento\Catalog\Model\Layer\Resolver $layerResolver
73+
* @param PostHelper $postDataHelper
74+
* @param Resolver $layerResolver
6675
* @param CategoryRepositoryInterface $categoryRepository
67-
* @param \Magento\Framework\Url\Helper\Data $urlHelper
76+
* @param Data $urlHelper
6877
* @param array $data
6978
*/
7079
public function __construct(
71-
\Magento\Catalog\Block\Product\Context $context,
72-
\Magento\Framework\Data\Helper\PostHelper $postDataHelper,
73-
\Magento\Catalog\Model\Layer\Resolver $layerResolver,
80+
Context $context,
81+
PostHelper $postDataHelper,
82+
Resolver $layerResolver,
7483
CategoryRepositoryInterface $categoryRepository,
75-
\Magento\Framework\Url\Helper\Data $urlHelper,
84+
Data $urlHelper,
7685
array $data = []
7786
) {
7887
$this->_catalogLayer = $layerResolver->get();
@@ -113,7 +122,7 @@ protected function _getProductCollection()
113122
/**
114123
* Get catalog layer model
115124
*
116-
* @return \Magento\Catalog\Model\Layer
125+
* @return Layer
117126
*/
118127
public function getLayer()
119128
{
@@ -137,7 +146,35 @@ public function getLoadedProductCollection()
137146
*/
138147
public function getMode()
139148
{
140-
return $this->getChildBlock('toolbar')->getCurrentMode();
149+
if ($this->getChildBlock('toolbar')) {
150+
return $this->getChildBlock('toolbar')->getCurrentMode();
151+
}
152+
153+
return $this->getDefaultListingMode();
154+
}
155+
156+
/**
157+
* Get listing mode for products if toolbar is removed from layout.
158+
* Use the general configuration for product list mode from config path catalog/frontend/list_mode as default value
159+
* or mode data from block declaration from layout.
160+
*
161+
* @return string
162+
*/
163+
private function getDefaultListingMode()
164+
{
165+
// default Toolbar when the toolbar layout is not used
166+
$defaultToolbar = $this->getToolbarBlock();
167+
$availableModes = $defaultToolbar->getModes();
168+
169+
// layout config mode
170+
$mode = $this->getData('mode');
171+
172+
if (!$mode || !isset($availableModes[$mode])) {
173+
// default config mode
174+
$mode = $defaultToolbar->getCurrentMode();
175+
}
176+
177+
return $mode;
141178
}
142179

143180
/**
@@ -148,28 +185,60 @@ public function getMode()
148185
protected function _beforeToHtml()
149186
{
150187
$collection = $this->_getProductCollection();
151-
$this->configureToolbar($this->getToolbarBlock(), $collection);
188+
189+
$this->addToolbarBlock($collection);
190+
152191
$collection->load();
153192

154193
return parent::_beforeToHtml();
155194
}
156195

157196
/**
158-
* Retrieve Toolbar block
197+
* Add toolbar block from product listing layout
198+
*
199+
* @param Collection $collection
200+
*/
201+
private function addToolbarBlock(Collection $collection)
202+
{
203+
$toolbarLayout = $this->getToolbarFromLayout();
204+
205+
if ($toolbarLayout) {
206+
$this->configureToolbar($toolbarLayout, $collection);
207+
}
208+
}
209+
210+
/**
211+
* Retrieve Toolbar block from layout or a default Toolbar
159212
*
160213
* @return Toolbar
161214
*/
162215
public function getToolbarBlock()
216+
{
217+
$block = $this->getToolbarFromLayout();
218+
219+
if (!$block) {
220+
$block = $this->getLayout()->createBlock($this->_defaultToolbarBlock, uniqid(microtime()));
221+
}
222+
223+
return $block;
224+
}
225+
226+
/**
227+
* Get toolbar block from layout
228+
*
229+
* @return bool|Toolbar
230+
*/
231+
private function getToolbarFromLayout()
163232
{
164233
$blockName = $this->getToolbarBlockName();
234+
235+
$toolbarLayout = false;
236+
165237
if ($blockName) {
166-
$block = $this->getLayout()->getBlock($blockName);
167-
if ($block) {
168-
return $block;
169-
}
238+
$toolbarLayout = $this->getLayout()->getBlock($blockName);
170239
}
171-
$block = $this->getLayout()->createBlock($this->_defaultToolbarBlock, uniqid(microtime()));
172-
return $block;
240+
241+
return $toolbarLayout;
173242
}
174243

175244
/**
@@ -203,7 +272,7 @@ public function setCollection($collection)
203272
}
204273

205274
/**
206-
* @param array|string|integer|\Magento\Framework\App\Config\Element $code
275+
* @param array|string|integer| Element $code
207276
* @return $this
208277
*/
209278
public function addAttribute($code)
@@ -223,7 +292,7 @@ public function getPriceBlockTemplate()
223292
/**
224293
* Retrieve Catalog Config object
225294
*
226-
* @return \Magento\Catalog\Model\Config
295+
* @return Config
227296
*/
228297
protected function _getConfig()
229298
{
@@ -233,8 +302,8 @@ protected function _getConfig()
233302
/**
234303
* Prepare Sort By fields from Category Data
235304
*
236-
* @param \Magento\Catalog\Model\Category $category
237-
* @return \Magento\Catalog\Block\Product\ListProduct
305+
* @param Category $category
306+
* @return $this
238307
*/
239308
public function prepareSortableFieldsByCategory($category)
240309
{
@@ -278,38 +347,38 @@ public function getIdentities()
278347
/**
279348
* Get post parameters
280349
*
281-
* @param \Magento\Catalog\Model\Product $product
350+
* @param Product $product
282351
* @return string
283352
*/
284-
public function getAddToCartPostParams(\Magento\Catalog\Model\Product $product)
353+
public function getAddToCartPostParams(Product $product)
285354
{
286355
$url = $this->getAddToCartUrl($product);
287356
return [
288357
'action' => $url,
289358
'data' => [
290359
'product' => $product->getEntityId(),
291-
\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlHelper->getEncodedUrl($url),
360+
ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlHelper->getEncodedUrl($url),
292361
]
293362
];
294363
}
295364

296365
/**
297-
* @param \Magento\Catalog\Model\Product $product
366+
* @param Product $product
298367
* @return string
299368
*/
300-
public function getProductPrice(\Magento\Catalog\Model\Product $product)
369+
public function getProductPrice(Product $product)
301370
{
302371
$priceRender = $this->getPriceRender();
303372

304373
$price = '';
305374
if ($priceRender) {
306375
$price = $priceRender->render(
307-
\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE,
376+
FinalPrice::PRICE_CODE,
308377
$product,
309378
[
310379
'include_container' => true,
311380
'display_minimal_price' => true,
312-
'zone' => \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST,
381+
'zone' => Render::ZONE_ITEM_LIST,
313382
'list_category_page' => true
314383
]
315384
);
@@ -322,7 +391,7 @@ public function getProductPrice(\Magento\Catalog\Model\Product $product)
322391
* Specifies that price rendering should be done for the list of products
323392
* i.e. rendering happens in the scope of product list, but not single product
324393
*
325-
* @return \Magento\Framework\Pricing\Render
394+
* @return Render
326395
*/
327396
protected function getPriceRender()
328397
{
@@ -348,7 +417,7 @@ protected function getPriceRender()
348417
private function initializeProductCollection()
349418
{
350419
$layer = $this->getLayer();
351-
/* @var $layer \Magento\Catalog\Model\Layer */
420+
/* @var $layer Layer */
352421
if ($this->getShowRootCategory()) {
353422
$this->setCategoryId($this->_storeManager->getStore()->getRootCategoryId());
354423
}
@@ -386,9 +455,8 @@ private function initializeProductCollection()
386455
if ($origCategory) {
387456
$layer->setCurrentCategory($origCategory);
388457
}
389-
390-
$toolbar = $this->getToolbarBlock();
391-
$this->configureToolbar($toolbar, $collection);
458+
459+
$this->addToolbarBlock($collection);
392460

393461
$this->_eventManager->dispatch(
394462
'catalog_block_product_list_collection',

0 commit comments

Comments
 (0)