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

Journal Article modelValidator should catch the exception when errors occur with featured image

    Details

      Description

      1. Start with a clean bundle and sign in as the default administrator.

      2. Create a web content article with a featured image uploaded from a local image file. Obtain its resourcePrimKey value from the database (usually the articleId displayed in the UI + 2).

      3. Substitute the value of the resourcePrimKey into the attached Groovy script and run it in Server Administration -> Script. The validation returns a success status and the script prints "No problems found."

      3a. In System Settings -> Web Content, remove the small image's extension from those allowed in File Uploads. Run the script again.

      Expected behaviour:
      The validation returns a failed status and the script prints the name of the small image, or something more wordy such as "Extension <extension> is not an allowed file upload type." Most other exception messages returned by JournalArticleValidator.validateModel() are similarly wordy, which is helpful.
      Observed behaviour:
      The validation returns a failed status and the script prints the name of some temporary file, e.g. 20200703172226709XNMOJAOB

      4. Create an invalid condition in the document library by by deleting the featured image's DLFileEntry or by deleting the contents of ${liferay_home}/data/document_library. (In our experience operating Liferay, we have in the past often seen corruption in the Document Library, so this kind of condition is expected in real life.) Run the script again.

      Expected behaviour:
      The model validator should catch the exception and the script should print its message text.
      Observed behaviour:
      Portal UI displays a "Your request failed to complete" error popup. Nothing is printed in the script output console or the portal log.

      validate.groovy

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yang.cao Yang Cao
              Reporter:
              noor.najjar Noor Najjar
              Participants of an Issue:
              Recent user:
              Jason Pince
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                43 weeks, 6 days ago

                  Packages

                  Version Package
                  7.2.10 DXP FP8
                  7.2.10.2 DXP SP3
                  7.2.X
                  7.3.5 CE GA6
                  7.3.10 DXP GA1
                  Master