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

Export users as CSV produces inconsistent date output due to caching



      When an export of users is performed, the output of dates are inconsistent, depending on if the user was cached or not. If the User is currently cached, all dates associated with that user are of the type java.util.Date. However, if the user was not currently in the cache, all dates are of the type java.sql.Timestamp. This causes the Export Users task to build a string out of two separate datatypes, generating inconsistent results in the output CSV.
      Steps to reproduce
      1. In the portal-ext.properties file, add the property users.export.csv.fields=firstName,middleName,lastName,emailAddress,createDate,lastLoginDate,screenName
      2. Start up Liferay and create 2 users and login as those 2 users (to set their lastLoginDate field in lportal.User_)
      3. Log in as Portal Administrator
      4. Navigate to Admin > Control Panel > Users and Organizations
      5. In a separate tab, navigate to Admin > Control Panel > Server Administration > Resources tab
      6. In your Users tab, click Export Users. Copy off the contents of the CSV for comparison
      7. In the Server Administration tab, click the 'Clear the database cache' button
      8. In your Users tab, click Export Users once again. Copy off the contents of the CSV
      9. Compare the contents of the 2 CSVs
      Results of Testing
      Expected Results: CSV display exported users last login in java Date format. Ex: Mon Jun 19 22:52:46 GMT 2017
      Actual Results: CSV displays exported users last login in different formats, depending on if they were in the database cache or not


        Issue Links



              hong.zhao Hong Zhao (Inactive)
              joshua.cords Joshua Cords
              Kiyoshi Lee Kiyoshi Lee
              0 Vote for this issue
              1 Start watching this issue


                5 years, 23 weeks ago


                  Version Package
                  6.2.X EE
                  7.0.0 DXP FP22
                  7.0.0 DXP SP4
                  7.0.X EE
                  7.0.4 CE GA5