Fix: #3347: Fixed searching members in space and users with white space in full name (Baleks)

This commit is contained in:
buddh4 2019-03-21 18:27:28 +01:00
parent 6753c52493
commit 2a22b52692
3 changed files with 8 additions and 2 deletions

View File

@ -10,6 +10,7 @@ HumHub Change Log
- Fix: Richtext preview new line backslash issue - Fix: Richtext preview new line backslash issue
- Enh: Migrated LDAP features into own submodule - Enh: Migrated LDAP features into own submodule
- Enh: Added new LDAP command line tools - Enh: Added new LDAP command line tools
- Fix: #3347: Fixed searching members in space and users with white space in full name (Baleks)
1.3.11 (March 06, 2019) 1.3.11 (March 06, 2019)

View File

@ -110,7 +110,9 @@ class UserSearch extends User
['like', 'user.username', $this->freeText], ['like', 'user.username', $this->freeText],
['like', 'user.email', $this->freeText], ['like', 'user.email', $this->freeText],
['like', 'profile.firstname', $this->freeText], ['like', 'profile.firstname', $this->freeText],
['like', 'profile.lastname', $this->freeText] ['like', 'profile.lastname', $this->freeText],
['like', 'concat(profile.firstname, " ", profile.lastname)', $this->freeText],
['like', 'concat(profile.lastname, " ", profile.firstname)', $this->freeText],
]); ]);
if (!empty($this->status)) { if (!empty($this->status)) {
@ -128,6 +130,7 @@ class UserSearch extends User
$query->andFilterWhere(['like', 'profile.lastname', $this->getAttribute('profile.lastname')]); $query->andFilterWhere(['like', 'profile.lastname', $this->getAttribute('profile.lastname')]);
if ($this->getAttribute('last_login') != "") { if ($this->getAttribute('last_login') != "") {
try { try {
$last_login = \humhub\libs\DateHelper::parseDateTime($this->getAttribute('last_login')); $last_login = \humhub\libs\DateHelper::parseDateTime($this->getAttribute('last_login'));

View File

@ -122,7 +122,9 @@ class MembershipSearch extends Membership
['like', 'user.username', $this->freeText], ['like', 'user.username', $this->freeText],
['like', 'user.email', $this->freeText], ['like', 'user.email', $this->freeText],
['like', 'profile.firstname', $this->freeText], ['like', 'profile.firstname', $this->freeText],
['like', 'profile.lastname', $this->freeText] ['like', 'profile.lastname', $this->freeText],
['like', 'concat(profile.firstname, " ", profile.lastname)', $this->freeText],
['like', 'concat(profile.lastname, " ", profile.firstname)', $this->freeText],
]); ]);
} }
if (!empty($this->group_id)) { if (!empty($this->group_id)) {