cancel
Showing results for 
Search instead for 
Did you mean: 

SelectUsersPopupWindow searchPeople should not put % around the name

olegpavliv
Champ in-the-making
Champ in-the-making
SelectUsersPopupWindow searchPeople() puts percent % around the name. Maybe it was done to do a search in a DB table.

But it is used in the LDAP search in activity-webapp-explorer. After inserting the % symbol the search result is empty in LDAP.

Here is a correct version of searchPeople() method


  protected void searchPeople(String searchText) {
    if (searchText.length() >= 2) {
      matchingUsersTable.removeAllItems();
     
      List<User> results = ProcessEngines.getDefaultProcessEngine()
              .getIdentityService()
              .createUserQuery()
//              .userFullNameLike("%" + searchText + "%")    // this code is incorrect
              .userFullNameLike(searchText)
              .list();
     
      for (User user : results) {
        if (!multiSelect || !selectedUsersTable.containsId(user.getId())) {
          if (ignoredUserIds == null || !ignoredUserIds.contains(user.getId())) {
            addMatchingUser(user.getId(), user.getFirstName() + " " + user.getLastName());
          }
        }
      }
    }
  }
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
Is this fixed by https://github.com/Activiti/Activiti/pull/581 ? Or is this something else?

olegpavliv
Champ in-the-making
Champ in-the-making
Yes, it seems to be the same issue. But it is not fixed yet on master.

https://github.com/Activiti/Activiti/blob/master/modules/activiti-explorer/src/main/java/org/activit...

jbarrez
Star Contributor
Star Contributor
No, it is fixed by this line in the LdapUserManager:

  final String fullNameLike = query.getFullNameLike().replaceAll("%", "");

olegpavliv
Champ in-the-making
Champ in-the-making
OK, I see.

It's a bit strange of fix: add percent characters around the name to replace them later.
Imagine that I have a percent character in the name. Then it won't be possible to find this entity because % will be removed.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.