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 can't create Email relationships #8293

Open
gahenderson opened this issue Nov 22, 2019 · 0 comments
Open

API can't create Email relationships #8293

gahenderson opened this issue Nov 22, 2019 · 0 comments
Labels
Area: API Issues & PRs related to all things regarding the API Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Type: Bug Bugs within the core SuiteCRM codebase

Comments

@gahenderson
Copy link
Contributor

gahenderson commented Nov 22, 2019

Issue

When looking to create a relationship between emails and other modules (tested with Accounts and Leads) this will fail, claiming to not find the link field.

Expected Behavior

A relationship is added between the records, and a success message is returned via the API

Actual Behavior

No link is created and the following error is returned in the body:

        "status": 400,
        "title": null,
        "detail": "Link field has not found in Lead to determine relationship for Email"
    } ```

#### Possible Fix
The bug appears to happen when the API BeanManager searches for the linked field name (getLinkedFieldName). There are 2 link names in the relationships table in the database and it retrieves the wrong one (this depends on which order they are returned by the database which I believe is ordered by id).

#### Steps to Reproduce
1. Create or find a pre-existing email & note its ID
2. In Postman, send 'Create Relationship' HTTP POST request eg
   ``` <suite host>/Api/V8/module/Emails/cd9fc6e2-3391-1c73-3183-5dd6a8ac56ef/relationships ```
with a body similar to
   ``` {
  "data": {
    "type": "Leads",
    "id": "18740080-7fbd-4966-f401-5d67daa9c6bd"
  }
} ```

#### Context
Looking to archive an email against the relevant record but this is not possible

#### Your Environment
OS: Ubuntu 18.04.3 LTS
Browser: Chrome 77.0.3865.90 64Bit
SuiteCRM: 7-11-8
Postman: 7.10.0 x64

@Dillon-Brown Dillon-Brown added Area: API Issues & PRs related to all things regarding the API Type: Bug Bugs within the core SuiteCRM codebase Priority:Critical Issues & PRs that are critical; broken core functionality, fatal errors - there are no workarounds labels Nov 25, 2019
@Mac-Rae Mac-Rae added Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds and removed Priority:Critical Issues & PRs that are critical; broken core functionality, fatal errors - there are no workarounds labels Nov 29, 2021
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:Important Issues & PRs that are important; broken functions, errors - there are workarounds Type: Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

3 participants