Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
6.2.4 CE GA5, 6.2.X EE
-
6.2.x
-
Committed
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
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
- Hit Invoke
- 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:
- Go to Site Administration and click on "Message Boards" under "Content"
- Click on the title of the message boards entry
- Click on the attachment (should have the name fileName.txt for the example inputStreamOVPs above)
- 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
- causes
-
LPS-55728 Cannot set priority and message format when adding message board post with attachment via JSON API
- Closed
- duplicates
-
LPS-61572 JSON WS calls fail on Websphere
-
- Open
-
- is caused by
-
LPS-31943 Unable to post files from JSONWS API page
- Closed
- is duplicated by
-
LPS-61107 NullPointerException when adding documents through JSON (affects SYNC and Screens)
- Closed
- relates
-
LPE-13610 Unable to add message board attachment via JSON
-
- Closed
-
-
LPE-14525 Add NPE protection for portletURLImpl generateToString.
-
- Closed
-
-
SYNC-1521 SyncJSONFilter prevents other JSON requests from adding files
-
- Closed
-