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

Unable to add message board attachment via JSON

Details

    Description

      Description
      Unable to add message board attachment via JSON

      Changed the JSONWS API. New steps to reproduce/test:
      1. Start Liferay and login as admin
      2. Go to

      {domain}/api/jsonws?contextName=&signature=%2Fmbmessage%2Fadd-message-7-groupId-categoryId-subject-body-fileName-file-serviceContext
      groupId: groupId of Guest group
      categoryId: 0
      subject: any string
      body: any string
      fileName: any valid file name with file type
      file: any file
      3. Go to Site Administration > Message Boards

      Expected results: Results tab shows the MBMessage created. Navigate to Site Administration > Message Boards. It should contain the MBMessage with the file attached.

      ----

      Old steps, not applicable!
      Steps to reproduce/Testing done
      # Start Liferay and login as admin
      # Go to {domain}

      /api/jsonws?signature=%2Fmbmessage%2Fadd-message-10-groupId-categoryId-subject-body-format-inputStreamOVPs-anonymous-priority-allowPingbacks-serviceContext

        • groupId: Enter the Site ID located in the Site Settings
        • categoryId: 0
        • Subject: Any string
        • Body: Any string
        • Format: html
        • inputStreamOVPs: [ {key: 'fileName.txt', value: [84,104,105,115,32,105,115,32,97,32,116,101,115,116,32,116,101,120,116,32,102,105,108,101,46]}

          ]

        • Anonymous: Any boolean value
        • Priority: 0
        • allowPingbacks: Any boolean value
      1. Hit Invoke
      2. Receive the following error:
        "Unable to convert to type: com.liferay.portal.kernel.util.ObjectValuePair"

      If inputStreamOVPs is set to:
      []
      The post submits successfully.

      To verify if the attachment has been uploaded successfully:

      1. Go to Site Administration and click on "Message Boards" under "Content"
      2. Click on the title of the message boards entry
      3. Click on the attachment (should have the name fileName.txt for the example inputStreamOVPs above)
      4. For the example above, verify that the contents are "This is a test text file."

      Results of Testing
      Expected behavior: The message board post and attachment is added
      Actual behavior: An error is returned and the post and attachment is not added

      Errors/Logs
      "Unable to convert to type: com.liferay.portal.kernel.util.ObjectValuePair"

      Reproduced...
      Reproduced in trunk? Unable to test; the JSON api has changed ( 66aed56d5b2e1b93d20660fb44b4316f7f0107ef)
      Reproduced in branch? Yes, "jodd.typeconverter.TypeConversionException" (1df12fe8e3e51d564926c8a86b4486fd3ee17589)

      Attachments

        Issue Links

          Activity

            People

              brian.chan Brian Chan
              kayleen.lim Kayleen Lim
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                7 years, 26 weeks, 5 days ago

                Packages

                  Version Package
                  6.2.5 CE GA6
                  6.2.X EE
                  7.0.0 M5