Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-15255

Using users.screen.name.allow.numeric=true, username validation fails with certain random numbers

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 6.0.5 GA
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      users.screen.name.allow.numeric=true

      Description

      I've noticed user creation fails with an UserScreenNameException with certain numbers.

      11:34:43,258 ERROR [UsuariosAltasImporter:251] user 10264
      com.liferay.portal.UserScreenNameException
      at com.liferay.portal.service.impl.UserLocalServiceImpl.validateScreenName(UserLocalServiceImpl.java:3242)

      After investigating the source code, at line 3242 i found:

      if (Validator.isNumber(screenName) &&
      !screenName.equals(String.valueOf(userId))) {

      if (!PropsValues.USERS_SCREEN_NAME_ALLOW_NUMERIC)

      { throw new UserScreenNameException(); }

      Group group = groupPersistence.fetchByPrimaryKey(
      GetterUtil.getLong(screenName));

      if (group != null) { throw new UserScreenNameException(); }

      }

      So, the username is failing validation because it exists a group with the same primary key.
      We are integrating liferay with an external system, and the username must be numeric and
      must be exactly the same as the external username.

      This behaviour makes the numeric username feature unusable for us, and this is why we think
      this is a bug.

      Any workaround, or if we can make the group id starts on a higer number (100000) for avoiding
      collisions will be apreciated also.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  9 years, 16 weeks, 3 days ago

                  Packages

                  Version Package