Skip to content

Commit b480b3b

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #14876: Changed return type of addToCartPostParams to array (by @LordZardeck) - #14822: Add default schedule config for sitemap_generate job (by @jameshalsall) - #12735: #12193 Catalog not filtered by admin search bar (by @hannassy) - #14892: Corrected @param in comment block (by @yogeshks) Fixed GitHub Issues: - #5768: Magento 2.0.7 XML sitemap is not generated by schedule (reported by @dexterityzx) has been fixed in #14822 by @jameshalsall in 2.2-develop branch Related commits: 1. 9463c77 2. d95f044 3. a065434 - #7861: Using search in Admin panel, and choosing "% in Products" returns full catalog (reported by @spyrule) has been fixed in #12735 by @hannassy in 2.2-develop branch Related commits: 1. 0666b27 2. f5d93c3 3. 790ac31 - #12193: Catalog not filtered by admin search bar (reported by @gianiaco) has been fixed in #12735 by @hannassy in 2.2-develop branch Related commits: 1. 0666b27 2. f5d93c3 3. 790ac31
2 parents e49ccf7 + 8e54d87 commit b480b3b

File tree

8 files changed

+82
-2
lines changed

8 files changed

+82
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public function getIdentities()
356356
* Get post parameters
357357
*
358358
* @param Product $product
359-
* @return string
359+
* @return array
360360
*/
361361
public function getAddToCartPostParams(Product $product)
362362
{
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\CatalogSearch\Ui\DataProvider\Product;
8+
9+
use Magento\Framework\Data\Collection;
10+
use Magento\CatalogSearch\Model\ResourceModel\Search\Collection as SearchCollection;
11+
use Magento\Ui\DataProvider\AddFilterToCollectionInterface;
12+
13+
/**
14+
* Class AddFulltextFilterToCollection
15+
*/
16+
class AddFulltextFilterToCollection implements AddFilterToCollectionInterface
17+
{
18+
/**
19+
* Search Collection
20+
*
21+
* @var SearchCollection
22+
*/
23+
private $searchCollection;
24+
25+
/**
26+
* @param SearchCollection $searchCollection
27+
*/
28+
public function __construct(SearchCollection $searchCollection)
29+
{
30+
$this->searchCollection = $searchCollection;
31+
}
32+
33+
/**
34+
* {@inheritdoc}
35+
*
36+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
37+
*/
38+
public function addFilter(Collection $collection, $field, $condition = null)
39+
{
40+
/** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */
41+
if (isset($condition['fulltext']) && !empty($condition['fulltext'])) {
42+
$this->searchCollection->addBackendSearchFilter($condition['fulltext']);
43+
$productIds = $this->searchCollection->load()->getAllIds();
44+
$collection->addIdFilter($productIds);
45+
}
46+
}
47+
}

app/code/Magento/CatalogSearch/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"magento/module-eav": "101.0.*",
1313
"magento/module-backend": "100.2.*",
1414
"magento/module-theme": "100.2.*",
15+
"magento/module-ui": "101.0.*",
1516
"magento/module-catalog-inventory": "100.2.*",
1617
"magento/framework": "101.0.*"
1718
},

app/code/Magento/CatalogSearch/etc/adminhtml/di.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@
1919
<type name="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front">
2020
<plugin name="search_weigh" type="Magento\CatalogSearch\Block\Plugin\FrontTabPlugin" />
2121
</type>
22+
<type name="Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider">
23+
<arguments>
24+
<argument name="addFilterStrategies" xsi:type="array">
25+
<item name="fulltext" xsi:type="object">Magento\CatalogSearch\Ui\DataProvider\Product\AddFulltextFilterToCollection</item>
26+
</argument>
27+
</arguments>
28+
</type>
2229
</config>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
9+
<listingToolbar name="listing_top">
10+
<filterSearch name="fulltext"/>
11+
</listingToolbar>
12+
</listing>

app/code/Magento/OfflineShipping/Block/Adminhtml/Form/Field/Export.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Export extends \Magento\Framework\Data\Form\Element\AbstractElement
2121
* @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
2222
* @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
2323
* @param \Magento\Framework\Escaper $escaper
24-
* @param \Magento\Backend\Helper\Data $helper
24+
* @param \Magento\Backend\Model\UrlInterface $backendUrl
2525
* @param array $data
2626
*/
2727
public function __construct(

app/code/Magento/Sitemap/Model/Observer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class Observer
1919

2020
/**
2121
* Cronjob expression configuration
22+
*
23+
* @deprecated Use \Magento\Cron\Model\Config\Backend\Sitemap::CRON_STRING_PATH instead.
2224
*/
2325
const XML_PATH_CRON_EXPR = 'crontab/default/jobs/generate_sitemaps/schedule/cron_expr';
2426

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,16 @@
4242
</valid_paths>
4343
</file>
4444
</sitemap>
45+
<crontab>
46+
<default>
47+
<jobs>
48+
<sitemap_generate>
49+
<schedule>
50+
<cron_expr>0 0 * * *</cron_expr>
51+
</schedule>
52+
</sitemap_generate>
53+
</jobs>
54+
</default>
55+
</crontab>
4556
</default>
4657
</config>

0 commit comments

Comments
 (0)