Skip to content

Commit c0fa1c9

Browse files
committed
MAGETWO-58014: [GitHub] page cache also caches breadcrumbs #5502
1 parent d14f616 commit c0fa1c9

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testIsCategoryUsedInProductUrl()
9595
* @param string $expectedName
9696
* @return void
9797
*/
98-
public function testGetProductName($product, $expectedName)
98+
public function testGetProductName($product, string $expectedName)
9999
{
100100
$this->catalogHelper->expects($this->atLeastOnce())
101101
->method('getProduct')

app/code/Magento/Catalog/view/frontend/web/js/product/breadcrumbs.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,9 @@ define([
8888
* @private
8989
*/
9090
_getCategoryCrumb: function (menuItem) {
91-
var categoryId,
92-
categoryName,
93-
categoryUrl;
94-
95-
categoryId = /(\d+)/i.exec(menuItem.attr('id'))[0];
96-
categoryName = menuItem.text();
97-
categoryUrl = menuItem.attr('href');
91+
var categoryId = /(\d+)/i.exec(menuItem.attr('id'))[0],
92+
categoryName = menuItem.text(),
93+
categoryUrl = menuItem.attr('href');
9894

9995
return {
10096
'name': 'category' + categoryId,

dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductViewBreadcrumbsCategory.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ public function processAssert(
3535
BrowserInterface $browser,
3636
CatalogProductSimple $product
3737
) {
38-
$categories = is_object($product->getDataFieldConfig('category_ids')['source']) ?
39-
$product->getDataFieldConfig('category_ids')['source']->getCategories()
38+
$categories = is_object($product->getDataFieldConfig('category_ids')['source'])
39+
? $product->getDataFieldConfig('category_ids')['source']->getCategories()
4040
: [];
4141

4242
if (!empty($categories)) {
43-
4443
/** @var Category $category */
4544
foreach ($categories as $category) {
4645
$cmsIndex->open();

0 commit comments

Comments
 (0)