Skip to content

Commit 526d296

Browse files
committed
Search in assign contact to role does not show all contacts (with postgres) #1905
1 parent 73f1498 commit 526d296

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

modules/contacts/contacts_data.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
*/
4949

5050
use Admidio\Infrastructure\Database;
51-
use Admidio\Infrastructure\Exception;
5251
use Admidio\Infrastructure\Utils\SecurityUtils;
5352
use Admidio\Organizations\Entity\Organization;
5453

@@ -67,9 +66,6 @@
6766

6867
header('Content-Type: application/json');
6968

70-
// show all members of all organizations
71-
$getMembersAllOrgs = $gSettingsManager->getBool('contacts_show_all');
72-
7369
if (isset($_SESSION['contacts_list_configuration'])) {
7470
$contactsListConfig = $_SESSION['contacts_list_configuration'];
7571
}
@@ -118,7 +114,7 @@
118114
}
119115

120116
foreach ($searchString as $searchWord) {
121-
$searchCondition .= ' AND CONCAT(' . implode(', \' \', ', $searchColumns) . ') LIKE LOWER(CONCAT(\'%\', ' . $searchValue . ', \'%\')) ';
117+
$searchCondition .= ' AND LOWER(CONCAT(' . implode(', \' \', ', $searchColumns) . ')) LIKE LOWER(CONCAT(\'%\', ' . $searchValue . ', \'%\')) ';
122118
$queryParamsSearch[] = htmlspecialchars_decode($searchWord, ENT_QUOTES | ENT_HTML5);
123119
}
124120

@@ -271,7 +267,7 @@
271267
ON cat_org.cat_id = rol_org.rol_cat_id
272268
WHERE mem_org.mem_usr_id = usr_id
273269
) AS member_org_ids,
274-
usr_login_name as loginname,
270+
usr_login_name as login_name,
275271
(SELECT email.usd_value FROM ' . TBL_USER_DATA . ' email
276272
WHERE email.usd_usr_id = usr_id
277273
AND email.usd_usf_id = ? /* $gProfileFields->getProperty(\'email\', \'usf_id\') */
@@ -386,7 +382,7 @@
386382

387383
// Administrators can change or send password if login is configured and user is member of current organization
388384
if ($contactsOfThisOrganization && $gCurrentUser->isAdministrator()
389-
&& !empty($row['loginname']) && $row['usr_uuid'] !== $gCurrentUserUUID) {
385+
&& !empty($row['login_name']) && $row['usr_uuid'] !== $gCurrentUserUUID) {
390386
if (!empty($row['member_email']) && $gSettingsManager->getBool('system_notifications_enabled')) {
391387
// if email is set and systemmails are activated then administrators can send a new password to user
392388
$userAdministration = '

modules/groups-roles/members_assignment_data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
}
137137

138138
foreach ($searchString as $searchWord) {
139-
$searchCondition .= ' AND concat(' . implode(', ', $searchColumns) . ') LIKE CONCAT(\'%\', ' . $searchValue . ', \'%\') ';
139+
$searchCondition .= ' AND LOWER(CONCAT(' . implode(', ', $searchColumns) . ')) LIKE LOWER(CONCAT(\'%\', ' . $searchValue . ', \'%\')) ';
140140
$queryParamsSearch[] = htmlspecialchars_decode($searchWord, ENT_QUOTES | ENT_HTML5);
141141
}
142142

0 commit comments

Comments
 (0)