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

Unable to get the user by email address that contains apostrophe

Description

    Steps to reproduce

    1. Add a user with apostrophe in its email address via curl as following, replace the value accordingly, the email address is user%[email protected]
      curl -X POST -u "[email protected]:test" -d "companyId=20098" -d "autoPassword=false" -d "password1=initPassword" -d "password2=initPassword" -d "autoScreenName=false" -d "screenName=usersn1" -d "emailAddress=user%[email protected]" -d "facebookId=0" -d "openId=" -d "locale=" -d "firstName=userfn1" -d "middleName=" -d "lastName=userln1" -d "prefixId=0" -d "suffixId=0" -d "male=true" -d "birthdayMonth=4" -d "birthdayDay=31" -d "birthdayYear=1986" -d "jobTitle=" -d "groupIds=" -d "organizationIds=" -d "roleIds=" -d "userGroupIds=" -d "sendEmail=true" -d "serviceContext={\"addGroupPermissions\" : true, \"addGuestPermissions\": true}" http://localhost:8080/api/jsonws/user/add-user
    2. Assert the user data returns
    3. Double check in the Users and Organizations > User list
    4. Assert the user is added
    5. Assert the new added user's email address displays as user'[email protected]
    6. Try to get the user by email address via curl
      curl -X GET -u "[email protected]:test" http://localhost:8080/api/jsonws/user/get-user-by-email-address/company-id/20098/email-address/user%[email protected]
    7. Assert no user data returns

    Actual Result
    No user returns after invoking.

    Expect Result
    The proper user data should returns since the user was added in portal successfully.

    Testray
    Poshi
    Jenkins

         [exec]     BUILD FAILED: No results for path: $['userId']
         [exec]     /opt/dev/projects/github/liferay-portal/portal-web/test/functional/com/liferay/portalweb/macros/json/user/JSONUserAPI.macro[_getUserIdByEmailAddress]:235
         [exec]     /opt/dev/projects/github/liferay-portal/portal-web/test/functional/com/liferay/portalweb/macros/json/user/JSONUserSetter.macro[setUserId]:94
         [exec]     /opt/dev/projects/github/liferay-portal/portal-web/test/functional/com/liferay/portalweb/macros/json/user/JSONUser.macro[setFirstPassword]:251
         [exec]     /opt/dev/projects/github/liferay-portal/portal-web/test/functional/com/liferay/portalweb/tests/coreinfrastructure/administration/users/cpusersandorganizations/UsersAdmin.testcase[AddUserEmailAddressApostrophe]:150
         [exec] 
         [exec] 
         [exec] com.liferay.poshi.runner.PoshiRunner > test[LocalFile.UsersAdmin#AddUserEmailAddressApostrophe] STANDARD_ERROR
         [exec]     java.lang.Exception: No results for path: $['userId']
         [exec]     	at com.liferay.poshi.core.util.ExternalMethod.execute(ExternalMethod.java:46)
         [exec]     	at com.liferay.poshi.core.util.ExternalMethod.execute(ExternalMethod.java:91)
    

    Attachments

      Issue Links

        Activity

          People

            jayda.wu Jayda Wu
            eric.park Eric Park
            Rafaela Nascimento Rafaela Nascimento
            Rafael Praxedes Rafael Praxedes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              25 weeks, 1 day ago

              Packages

                Version Package
                7.4.3.35 CE GA35
                7.4.3.55 CE GA55
                Master