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

Validating startTime and endTime does not consider their time zone

    Details

      Description

      The specific bug causes two different behaviors.

      Reproduction steps:

      1. Start the server.
      2. Go to actual user's "My Account" panel and set timezone property to a time zone one hour later in the future in relation to the browser's time zone.
        • For example, if your browser's time zone offset at the moment is UTC+2, your user's time zone should have offset of UTC+3 at the moment.
        • One of the combinations we use was Europe/Lisbon for browser's time and Europe/Madrid for user's time.
        • Pay attention to daylight saving times - if they are in effect in one of the time zones, the difference between the time zones can be different than 1 hour.
      3. Go to Admin/Pages, Export, Choose Content, Change Date Range. In the popup window choose date Range.
      4. Set the start date to today then set the start time to one hour before the end time.
      5. Click in "Ok"

      Expected results

      • The operation would be accepted.

      Actual results

      • "End date must be greater than start date." message will be shown on ui despite starTime lower that endTime.

      This error is caused by validating dates without time-zone information.

      Reproduction steps:

      With the same setup above

      1. Close popup if it is opened and reload SitePages.
      2. Go to Export/Choose Content and click on Change in Date Range section.
      3. If you modify endDate only for example: if startDate is 10/01/2014 03:58 PM then modify endDate to 10/01/2014 03:00 PM and the actual time is 02:58 PM.
      4. Click on OK button.

      Expected results

      • The "End date must be greater than start date" should appear

      Actual results

      • In this case you will get the following exception:
      16:01:10,528 ERROR [http-bio-8080-exec-9][IncludeTag:129] Current URL /group/control_panel/manage?p_auth=yyW8KRRO&p_p_auth=uw
      05dagu&p_p_id=156&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&doAsGroupId=10182&refererPlid=10185&controlPanelCategory=
      current_site.pages&_156_exportLAR=true&_156_struts_action=%2Fgroup_pages%2Fexport_layouts generates exception: com.liferay.po
      rtal.kernel.lar.PortletDataException
      com.liferay.portal.kernel.lar.PortletDataException
              at com.liferay.portal.lar.PortletDataContextFactoryImpl.validateDateRange(PortletDataContextFactoryImpl.java:257)
              at com.liferay.portal.lar.PortletDataContextFactoryImpl.createPreparePortletDataContext(PortletDataContextFactoryImpl
      .java:139)
              at com.liferay.portal.kernel.lar.PortletDataContextFactoryUtil.createPreparePortletDataContext(PortletDataContextFact
      oryUtil.java:62)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java
      :78)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53
      )
              at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:312)
              at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:193)
              at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:84)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java
      :78)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53
      )
              at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:312)
              at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:193)
              at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:84)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      
      

      Keep in mind that this issue is depends on browser's actual date and timezone and user's timezone.

        Attachments

        1. fixed.png
          fixed.png
          67 kB
        2. lps50357-ee-6.2.x-smaller.gif
          lps50357-ee-6.2.x-smaller.gif
          7.21 MB
        3. lps50357-part1-smaller.gif
          lps50357-part1-smaller.gif
          7.46 MB
        4. lps50357-part2-smaller.gif
          lps50357-part2-smaller.gif
          5.96 MB
        5. reproduced.png
          reproduced.png
          86 kB
        6. video1.avi
          2.49 MB
        7. video2.avi
          4.70 MB

          Issue Links

            Activity

              People

              Assignee:
              hong.zhao Hong Zhao (Inactive)
              Reporter:
              zsolt.szabo Zsolt Szabo (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 9 weeks, 3 days ago

                  Packages

                  Version Package
                  6.2.4 CE GA5
                  6.2.X EE
                  7.0.0 M5