Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API V8 doesn't work with id's that are no UUID #8890

Open
DavyVanElst opened this issue Oct 9, 2020 · 2 comments
Open

API V8 doesn't work with id's that are no UUID #8890

DavyVanElst opened this issue Oct 9, 2020 · 2 comments
Labels
Area: API Issues & PRs related to all things regarding the API Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Type:Suggestion Issue containing a suggestion of functionality, process or UI. Associated PRs are called enhancement

Comments

@DavyVanElst
Copy link

Issue

I have created some records (Accounts and Contacts) that are imported from an external system and I've used the id's from the external system as the id in SuiteCRM as well. This is possible by setting the 'strict_id_validation' => false, in the config.php file. However this doesn't work with the V8 API that has a hardcoded requirement on the format of the id, rejecting calls made to id's that are not in the UUID format.

Expected Behavior

The Api V8 should accept all the id formats that are accepted by the UI and as such also use the value of the strict_id_validation' flag.

Actual Behavior

The Api V8 uses its own hardcoded regular expression as specified in the file Api/V8/Param/Options/Id.php, which only allows UUID's.

Possible Fix

Change the id.php to either (best case) use the exact same validation as the UI for id's or (not optimal case) use a different regular expression when the strict_id_validation flag is not set.

Steps to Reproduce

1.Set the 'strict_id_validation' => false, in the config.php.
2.Import (create) a Contact with an id that is not a UUID.
3.Try to get the Contact based on the id.

Context

I'm using the api to connect to other systems, however I have located the regular expression and corrected it to work for me, however this solution is not upgrade proof.

Your Environment

  • SuiteCRM Version used:
    Version 7.11.13
    Sugar Version 6.5.25 (Build 344)
@pgorod
Copy link
Contributor

pgorod commented Oct 12, 2020

SuiteCRM should not restrict its ID's to UUIDs. Breaks backwards compatibility, causes unnecessary pain in integrations and migrations. I say this loud and clear, every chance I get, since the sad day where that "validation" was introduced... sigh...

@johnM2401 johnM2401 added Area: API Issues & PRs related to all things regarding the API Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Type:Suggestion Issue containing a suggestion of functionality, process or UI. Associated PRs are called enhancement labels Oct 19, 2020
@SuiteBot
Copy link

This issue has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/relationships-between-modules/91830/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: API Issues & PRs related to all things regarding the API Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Type:Suggestion Issue containing a suggestion of functionality, process or UI. Associated PRs are called enhancement
Projects
None yet
Development

No branches or pull requests

4 participants