Skip to content

V8 API: 2nd OR on same field gives only results for 2nd filter #9744

Open
@ebogaard

Description

@ebogaard

Issue

Expected Behavior

When using an OR more than once on the same field, you expect to get results that satisfy both filters.
For example: /V8/module/Accounts?filter[name][eq]=A&filter[operator]=or&filter[name][eq]=B

Should give all Accounts with name A or B.

Actual Behavior

When using this filter, we only get Accounts that satisfy the second filter. The first filter seems to be ignored.

When using an OR on two separate fields, the OR operator works as expected and gives results that satisfy both fitlers.

Possible Fix

n/a

Steps to Reproduce

  1. Make sure there is an account called "A" and one called "B"
  2. Try API V8 filter twice on same field: /V8/module/Accounts?filter[name][eq]=A&filter[operator]=or&filter[name][eq]=B
  3. See that you only get Account "B", while account "A" is expected in the results as well.

Context

Your Environment

  • SuiteCRM Version used: 7.12.6
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)):
  • Environment name and version (e.g. MySQL, PHP 7): PHP 7.4, MariaDB 10.4
  • Operating System and version (e.g Ubuntu 16.04): EL 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: APIIssues & PRs related to all things regarding the APIPriority:ImportantIssues & PRs that are important; broken functions, errors - there are workaroundsStatus:Fix ProposedA issue that has a PR related to it that provides a possible resolutionType: BugBugs within the core SuiteCRM codebase

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions