Commit ba831b2c authored by alexpott's avatar alexpott

Revert "Issue #2405907 by MrHaroldA: Views combined filters add redundant...

Revert "Issue #2405907 by MrHaroldA: Views combined filters add redundant separators in CONCAT_WS()"

This reverts commit 8c30ce93.
parent 312aa7cf
......@@ -77,7 +77,15 @@ public function query() {
}
}
if ($fields) {
$expression = implode(', ', $fields);
$count = count($fields);
$separated_fields = array();
foreach ($fields as $key => $field) {
$separated_fields[] = $field;
if ($key < $count-1) {
$separated_fields[] = "' '";
}
}
$expression = implode(', ', $separated_fields);
$expression = "CONCAT_WS(' ', $expression)";
$info = $this->operators();
......
......@@ -81,49 +81,6 @@ public function testFilterCombineContains() {
$this->assertIdenticalResultset($view, $resultset, $this->column_map);
}
/**
* Tests filtering result using a phrase that matches combined fields.
*/
public function testFilterCombineContainsPhrase() {
$view = Views::getView('test_view');
$view->setDisplay();
$fields = $view->displayHandlers->get('default')->getOption('fields');
$view->displayHandlers->get('default')->overrideOption('fields', $fields + array(
'job' => array(
'id' => 'job',
'table' => 'views_test_data',
'field' => 'job',
'relationship' => 'none',
),
));
// Change the filtering.
$view->displayHandlers->get('default')->overrideOption('filters', array(
'age' => array(
'id' => 'combine',
'table' => 'views',
'field' => 'combine',
'relationship' => 'none',
'operator' => 'contains',
'fields' => array(
'name',
'job',
),
'value' => 'ohn Si',
),
));
$this->executeView($view);
$resultset = array(
array(
'name' => 'John',
'job' => 'Singer',
),
);
$this->assertIdenticalResultset($view, $resultset, $this->column_map);
}
/**
* Tests if the filter can handle removed fields.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment