[MODUSERS-306] POST and PUT of user object fail with error "Invalid Text format" if the object contains a non-required customFields of type text and the value is an empty string Created: 17/Mar/22 Updated: 13/Jun/22 Resolved: 18/Apr/22 |
|
| Status: | Closed |
| Project: | mod-users |
| Components: | None |
| Affects versions: | None |
| Fix versions: | 18.3.0 |
| Type: | Bug | Priority: | P3 |
| Reporter: | Lisa Sjögren | Assignee: | Javokhir Abdullaev |
| Resolution: | Done | Votes: | 0 |
| Labels: | back-end, epam-spitfire, support | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue links: |
|
||||||||||||||||
| Sprint: | Spitfire Sprint 137 | ||||||||||||||||
| Story Points: | 2 | ||||||||||||||||
| Development Team: | Spitfire | ||||||||||||||||
| Release: | Morning Glory (R2 2022) | ||||||||||||||||
| RCA Group: | Requirements change | ||||||||||||||||
| Description |
|
Overview: This is a problem for libraries with customFields who regularly load users in batch from delimited files that they receive from their institutional student/staff database. The data is likely to contain empty strings for some users/properties. If FOLIO's API's don't accept those empty strings, the library would need to remove the entire field from the user object before posting it. This, besides being inconsistent with how FOLIO handles other empty strings on the user record, requires scripting conditions and validation and so raises the the bar for batch importing users significantly. (Given the user and user-import APIs accept empty strings for non-required fields a library pretty much only needs to map the source data fields to the FOLIO json properties in order to be able to iterative over a delimited file to import their users using something like Postman's Collection Runner.) Steps to Reproduce:
"customFields": { "atheletics_1": "opt_2", "quick-note_1": "" } Expected Results: Actual Results: The POST/PUT fails with the following error:
{
"errors": [
{
"message": "Invalid Text format",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "quick-note_1",
"value": "\"\""
}
]
}
]
}
If I perform the same import using user-import, I get a generic error message that does not explain at all why the import failed.
{
"message": "Users were imported successfully.",
"createdRecords": 0,
"updatedRecords": 0,
"failedRecords": 1,
"failedUsers": [
{
"username": "10066ddah96",
"externalSystemId": "100sah6696",
"errorMessage": "Failed to update user with externalSystemId: 100sah6696"
}
],
"totalRecords": 1
}
Interested parties: NUST Library |
| Comments |
| Comment by Ann-Marie Breaux (Inactive) [ 21/Mar/22 ] |
|
Hi Khalilah Gambrell No dev team or specific project assigned to this bug. Do you think it belongs to Users or Custom fields? |
| Comment by Pavlo Smahin [ 28/Mar/22 ] |
|
Ann-Marie Breaux. it belongs to custom fields. |
| Comment by Khalilah Gambrell [ 28/Mar/22 ] |
|
Pavlo Smahin - Morning Glory |
| Comment by Khalilah Gambrell [ 12/Apr/22 ] |
|
Lisa Sjögren can you help with testing this issue? You would need to use snapshot for testing. |
| Comment by Javokhir Abdullaev [ 15/Apr/22 ] |
|
hi! Lisa Sjögren, Khalilah Gambrell uploaded some screenshots and recorded video that shows no more errors are thrown when creating (updating) user with empty custom field of a type text. |
| Comment by Javokhir Abdullaev [ 15/Apr/22 ] |
|
in response, there is no empty custom field |
| Comment by Javokhir Abdullaev [ 15/Apr/22 ] |
| Comment by Javokhir Abdullaev [ 15/Apr/22 ] |
|
|