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

/api/jsonws input fields do not support new lines

    Details

      Description

      Issue
      Input fields in /api/jsonws page for functions do not support multiline/newline-inclusive parameters

      Steps to reproduce

      1. Start a clean bundle
      2. Login as admin
      3. Add the Calendar widget into the home page
      4. Click on My Calendars > ▼ > Manage Calendars
      5. Click on Options icon and HOVER on Import
        From the linked URL, note the xxx_calendarId value (30824)
      6. Go to http://localhost:8080/api/jsonws
      7. Select Calendar as Context name
      8. Click on Import-Calendar method
      9. Fill in the calendarId retrieved on step 5
      10. Set type as "ics"
      11. Open the attached ics file in your favorite editor
      12. Convert all linebreaks to \n so it's a 1 line string
      13. Copy that string into the Data field and Invoke

       

      Actual results
      Field is rendered as Input tag and execution fails

      The following error is displayed

      "Error at line 1:Expected [VCALENDAR], read [VCALENDAR\\nMETHOD]"

      Expected results
      Field is rendered as Textarea tag and execution succeeds

      Example of expected:

      1. Open the browser's development tools
      2. Change the <input to <textarea to convert the Data field to a textarea
      3. Paste the contents of the ics file (as is, with linebreaks)
      4. Invoke
      5. Execution is successful

       

      Reproduced in
      7.0.x (b0c47f5f335c5d32d2949b6bd54374eadc428c23)
      7.1.x (cc4ecbff91a19e3206cc5bdca1060804cee6a8b1)
      master (d6e4f5c6b99aa7c69b8907d0377d458cd2ff22ad)

      * Please see Zendesk Support tab for further comments and attachments.

        Attachments

        1. master.mp4
          3.50 MB
        2. result.PNG
          result.PNG
          19 kB
        3. sample.ics
          0.8 kB

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                50 weeks, 1 day ago

                Packages

                Version Package
                7.0.0 DXP FP70
                7.0.X
                7.1.10 DXP FP7
                7.1.10.2 SP2
                7.1.3 CE GA4
                7.1.X
                Master