Skip to content

Commit b9ea131

Browse files
author
Dale Sikkema
committed
Merge branch 'MAGETWO-35833-backup-filter' into develop
2 parents 914f576 + f372d13 commit b9ea131

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

app/code/Magento/Backup/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
The Backup module allows administrators to perform backups and rollbacks. Types of backups include system, database and media backups. This module relies on the Cron module to schedule backups.
22

3-
This module does not effect the storefront.
3+
This module does not affect the storefront.

app/code/Magento/Backup/view/adminhtml/layout/backup_index_block.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
<arguments>
4747
<argument name="header" xsi:type="string" translate="true">Name</argument>
4848
<argument name="index" xsi:type="string">display_name</argument>
49-
<argument name="filter" xsi:type="string">0</argument>
5049
<argument name="sortable" xsi:type="string">1</argument>
5150
<argument name="column_css_class" xsi:type="string">col-name</argument>
5251
<argument name="header_css_class" xsi:type="string">col-name</argument>

lib/internal/Magento/Framework/Data/Collection/Filesystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ public function getAllIds()
696696
*/
697697
public function filterCallbackLike($field, $filterValue, $row)
698698
{
699-
$filterValueRegex = str_replace('%', '(.*?)', preg_quote($filterValue, '/'));
699+
$filterValueRegex = str_replace('%', '(.*?)', str_replace('\'', '', preg_quote($filterValue, '/')));
700700
return (bool)preg_match("/^{$filterValueRegex}\$/i", $row[$field]);
701701
}
702702

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/***
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Framework\Data\Test\Unit\Collection;
8+
9+
class FilesystemTest extends \PHPUnit_Framework_TestCase
10+
{
11+
/** @var \Magento\Framework\Data\Collection\Filesystem */
12+
private $model;
13+
14+
public function setUp()
15+
{
16+
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
17+
$this->model = $objectManager->getObject('Magento\Framework\Data\Collection\Filesystem');
18+
}
19+
20+
public function testFilterCallbackLike()
21+
{
22+
$field = 'field';
23+
$row = [$field => 'beginning_filter_target_end',];
24+
$filterValueSuccess = new \Zend_Db_Expr('%filter_target%');
25+
$filterValueFailure = new \Zend_Db_Expr('%not_found_in_the_row%');
26+
27+
$this->assertTrue($this->model->filterCallbackLike($field, $filterValueSuccess, $row));
28+
$this->assertFalse($this->model->filterCallbackLike($field, $filterValueFailure, $row));
29+
}
30+
}

0 commit comments

Comments
 (0)