-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(search): allow contacts person search #41457
Conversation
81de941
to
0f373c7
Compare
Likely unrelated to your changes but I ran into There must be a discrepancy between |
@hamza221 how do I best test this? still the curl |
yes that's how I tested |
@hamza221 set an avatar for your test user then you will run into #41457 (comment) too 🙊 |
The db query is wrong. There is a big OR at the top level that circumvents the scoping to address books SELECT
DISTINCT `cp`.`cardid`
FROM
`*PREFIX*cards_properties` `cp`
WHERE
(
(
(`cp`.`addressbookid` = :dcValue1)
OR (`cp`.`addressbookid` = :dcValue2)
OR (`cp`.`addressbookid` = :dcValue3)
OR (`cp`.`addressbookid` = :dcValue4)
OR (`cp`.`addressbookid` = :dcValue5)
)
AND (`cp`.`name` IN (:dcValue6))
AND (
`cp`.`value` COLLATE utf8mb4_general_ci LIKE :dcValue7
)
)
OR (
`cp`.`value` COLLATE utf8mb4_general_ci LIKE :dcValue8
)
LIMIT
5 |
@@ -1182,6 +1183,13 @@ private function searchByAddressBookIds(array $addressBookIds, | |||
$query2->setFirstResult($options['offset']); | |||
} | |||
|
|||
if(isset($options['person'])){ | |||
if('' !== $pattern){ | |||
$query2->orWhere($query2->expr()->ilike('cp.value', $query2->createNamedParameter('%' . $this->db->escapeLikeParameter($options['person']) . '%'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$query2->orWhere($query2->expr()->ilike('cp.value', $query2->createNamedParameter('%' . $this->db->escapeLikeParameter($options['person']) . '%'))); | |
$query2->andWhere($query2->expr()->ilike('cp.value', $query2->createNamedParameter('%' . $this->db->escapeLikeParameter($options['person']) . '%'))); |
to fix #41457 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change the feature works as expected for me. If there is a regular contact with the same name as the filtered user, I will see the contact. If there is no match, I see nothing 👍
bf9afc2
to
19c21f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works 🚀
Signed-off-by: hamza221 <hamzamahjoubi221@gmail.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
19c21f2
to
26ee5a5
Compare
whooot somebody is going to hit that merge button!!!! /me holds breath |
Some actions fail. But it's not the job/checks that fail but the runner. |
Summary
TODO
Checklist