Suitecrm: Api/V8 create record does not support unicode and space in attributes

Created on 29 Oct 2018  路  8Comments  路  Source: salesagility/SuiteCRM

When create record with Api/V8 it validate attributes with regex pattern const REGEX_FIELD_PATTERN = '/[^\w-,]/', so if you use unicode or space on value will occur error "The option attributes with value array is invalid." in the response.

API Important 2 Fix Proposed Bug

Most helpful comment

I've changed regex original pattern to new pattern const REGEX_FIELD_PATTERN = '/[^\w-,\s\]/' and json_encode value before send to API. But this is just for temporary fix and not upgrade safe.

All 8 comments

Hey, were you able to do a temporary fix for this?

I've changed regex original pattern to new pattern const REGEX_FIELD_PATTERN = '/[^\w-,\s\]/' and json_encode value before send to API. But this is just for temporary fix and not upgrade safe.

Hi

Any idea when we can expect this to be released?
Is there a pull request for this? I see there are 230 open pull requests.
Our usage of SuiteCRM is stuck on this feature.

Hi @capkuan

Is it possible to you to send a PR to hotfix branch with your fix?
We are using this API and earlier than later this issue will bother us too.

I think this error might effecting file uploads as well...
I cant use the "=" sign in any field ( including the filename_file field - which you need for base64 ) - giving the "The option \"attributes\" with value array is invalid. error message..

I will try the fix and report back..
v7.11.1, ubuntu 16.04, mariadb 10.2

This is blocking our use of the API as well. Anyone know when it will be fixed in main?

Hi @patrickstump, there's a proposed fix here: #6901 but it will need to be code-reviewed + assessed before it can be merged. Have you tried out the fix yourself? if you are able to test it out and leave a comment saying so in that PR it will help us to get it merged faster. Thanks.

I have tried the change const REGEX_FIELD_PATTERN = '/[^\w-,\s\\.\]]/';" adding the \s\\. and my issue was resolved. Please let me know if there is something I can do to help expedite the testing.

Was this page helpful?
0 / 5 - 0 ratings