[COMPONENT][Search] Fix searching for actors

This commit is contained in:
2021-12-08 21:25:48 +00:00
parent 139da2c07f
commit bc3e6ac704
3 changed files with 12 additions and 8 deletions

View File

@@ -80,12 +80,12 @@ abstract class Parser
$ret = Event::handle('SearchCreateExpression', [$eb, $term, $language, &$note_res, &$actor_res]);
if (\is_null($note_res) && \is_null($actor_res)) {
throw new ServerException("No one claimed responsibility for a match term: {$term}");
} elseif (!\is_null($note_res)) {
}
if (!\is_null($note_res)) {
$note_parts[] = $note_res;
} elseif (!\is_null($actor_res)) {
}
if (!\is_null($actor_res)) {
$actor_parts[] = $actor_res;
} else {
throw new ServerException('Unexpected state in Search parser');
}
$right = $left = $index + 1;
@@ -109,7 +109,8 @@ abstract class Parser
if (!empty($note_parts)) {
self::connectParts($note_parts, $note_criteria_arr, $last_op, $eb, force: true);
$note_criteria = new Criteria($eb->orX(...$note_criteria_arr));
} elseif (!empty($actor_parts)) {
}
if (!empty($actor_parts)) {
self::connectParts($actor_parts, $actor_criteria_arr, $last_op, $eb, force: true);
$actor_criteria = new Criteria($eb->orX(...$actor_criteria_arr));
}