Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.2-develop
Browse files Browse the repository at this point in the history
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
  • Loading branch information
magento-engcom-team authored Apr 28, 2018
2 parents e49ccf7 + 8e54d87 commit b480b3b
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Block/Product/ListProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public function getIdentities()
* Get post parameters
*
* @param Product $product
* @return string
* @return array
*/
public function getAddToCartPostParams(Product $product)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\CatalogSearch\Ui\DataProvider\Product;

use Magento\Framework\Data\Collection;
use Magento\CatalogSearch\Model\ResourceModel\Search\Collection as SearchCollection;
use Magento\Ui\DataProvider\AddFilterToCollectionInterface;

/**
* Class AddFulltextFilterToCollection
*/
class AddFulltextFilterToCollection implements AddFilterToCollectionInterface
{
/**
* Search Collection
*
* @var SearchCollection
*/
private $searchCollection;

/**
* @param SearchCollection $searchCollection
*/
public function __construct(SearchCollection $searchCollection)
{
$this->searchCollection = $searchCollection;
}

/**
* {@inheritdoc}
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function addFilter(Collection $collection, $field, $condition = null)
{
/** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */
if (isset($condition['fulltext']) && !empty($condition['fulltext'])) {
$this->searchCollection->addBackendSearchFilter($condition['fulltext']);
$productIds = $this->searchCollection->load()->getAllIds();
$collection->addIdFilter($productIds);
}
}
}
1 change: 1 addition & 0 deletions app/code/Magento/CatalogSearch/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"magento/module-eav": "101.0.*",
"magento/module-backend": "100.2.*",
"magento/module-theme": "100.2.*",
"magento/module-ui": "101.0.*",
"magento/module-catalog-inventory": "100.2.*",
"magento/framework": "101.0.*"
},
Expand Down
7 changes: 7 additions & 0 deletions app/code/Magento/CatalogSearch/etc/adminhtml/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@
<type name="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front">
<plugin name="search_weigh" type="Magento\CatalogSearch\Block\Plugin\FrontTabPlugin" />
</type>
<type name="Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider">
<arguments>
<argument name="addFilterStrategies" xsi:type="array">
<item name="fulltext" xsi:type="object">Magento\CatalogSearch\Ui\DataProvider\Product\AddFulltextFilterToCollection</item>
</argument>
</arguments>
</type>
</config>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<listingToolbar name="listing_top">
<filterSearch name="fulltext"/>
</listingToolbar>
</listing>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Export extends \Magento\Framework\Data\Form\Element\AbstractElement
* @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
* @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
* @param \Magento\Framework\Escaper $escaper
* @param \Magento\Backend\Helper\Data $helper
* @param \Magento\Backend\Model\UrlInterface $backendUrl
* @param array $data
*/
public function __construct(
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/Sitemap/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class Observer

/**
* Cronjob expression configuration
*
* @deprecated Use \Magento\Cron\Model\Config\Backend\Sitemap::CRON_STRING_PATH instead.
*/
const XML_PATH_CRON_EXPR = 'crontab/default/jobs/generate_sitemaps/schedule/cron_expr';

Expand Down
11 changes: 11 additions & 0 deletions app/code/Magento/Sitemap/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,16 @@
</valid_paths>
</file>
</sitemap>
<crontab>
<default>
<jobs>
<sitemap_generate>
<schedule>
<cron_expr>0 0 * * *</cron_expr>
</schedule>
</sitemap_generate>
</jobs>
</default>
</crontab>
</default>
</config>

0 comments on commit b480b3b

Please sign in to comment.