Commit d36f21d6 authored by yched's avatar yched
Browse files

fix typo and replace with concise code

parent ebb074b0
......@@ -579,25 +579,20 @@ function _node_reference_potential_references_standard($field, $string = '', $ma
}
if ($string !== '') {
$args = array();
switch ($match) {
case 'contains':
$op = 'LIKE';
$value = '%' . $string . '%';
$query->condition('n.title', '%' . $string . '%', 'LIKE');
break;
case 'starts_with':
$op = 'LIKE';
$value = $string . '%';
$query->condition('n.title', $string . '%', 'LIKE');
break;
case 'equals':
default: // no match type or incorrect match type: use "="
$op = '=';
$value = $string . '%';
$query->condition('n.title', $string);
break;
}
$query->condition('n.title', $value, $op);
}
elseif ($ids) {
$query->condition('n.nid', $ids, 'IN', $ids);
......
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