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

Error message is not displayed on the UI even if a title of Announcement portlet exceeds 75 characters.

    Details

      Description

      Background
      "AnnouncementsEntry.title" column is defined as VARCHAR(75), so announcement titles cannot exceed 75 characters.

      Issue
      There is no length validation in place and announcement creation fails (with no UI error!) when posting an announcement with a title longer than 75 characters.

      Steps to reproduce

      1. Add a announcement portlet any page
      2. Add a new announcement
      3. Enter the title exceeds 75 characters
      4. Enter any content to content body
      5. Click Save

      Actual result
      The announcement is not registered and no error message is displayed on the UI.
      The following message is thrown in the log.

      2020-08-20 01:24:05.160 ERROR [http-nio-8080-exec-7][JDBCExceptionReporter:234] Data truncation: Data too long for column 'title' at row 1
      2020-08-20 01:24:05.163 ERROR [http-nio-8080-exec-7][PortletServlet:119] javax.portlet.PortletException: org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; SQL [update AnnouncementsEntry set uuid_=?, companyId=?, userId=?, userName=?, createDate=?, modifiedDate=?, classNameId=?, classPK=?, title=?, content=?, url=?, type_=?, displayDate=?, expirationDate=?, priority=?, alert=? where entryId=?]; nested exception is org.hibernate.exception.DataException: Could not execute JDBC batch update
      javax.portlet.PortletException: org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; SQL [update AnnouncementsEntry set uuid_=?, companyId=?, userId=?, userName=?, createDate=?, modifiedDate=?, classNameId=?, classPK=?, title=?, content=?, url=?, type_=?, displayDate=?, expirationDate=?, priority=?, alert=? where entryId=?]; nested exception is org.hibernate.exception.DataException: Could not execute JDBC batch update

      Expected result
      The announcement is not registered and error message is displayed on the UI.

      Reproduced in
      DXP-7
      72x Commit: f666322f66c2f56a22f04852f62471176608717d
      master Commit: 12dd798021f91789edea2c2b81352434579c8991

        Attachments

          Activity

            People

            Assignee:
            chao.wang Chao Wang
            Reporter:
            binh.tran Binh Tran
            Participants of an Issue:
            Recent user:
            Enterprise Release HU
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              7 weeks, 5 days ago

                Packages

                Version Package
                7.2.X
                7.3.X
                7.3.5 CE GA6
                7.3.10 DXP GA1
                Master