Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.52k stars 2.81k forks source link

linkedObjectsIds is null when doing a search #32096

Open denes44 opened 3 days ago

denes44 commented 3 days ago

Bug

The API return null for the linkedObjectsIds field when doing a search, but when querying the order directly, it returns the references correctly.

Dolibarr Version

20.0.2

Environment PHP

8.2.24

Environment Database

MySQL or MariaDB 10.9.8-MariaDB-1:10.9.8+maria~deb11

Steps to reproduce the behavior and expected behavior

Result of: GET http://dolibarr_ip/dolibarr/api/index.php/orders?sqlfilters=ref:like:SO2411-0003

[
  {
    "module": null,
    "id": "5",
    "entity": "1",
    "import_key": null,
    "array_options": [],
    "array_languages": null,
    "contacts_ids": [],
    "linkedObjectsIds": null,
    "canvas": null,
    "fk_project": null,
    "contact_id": null,
    "user": null,
    "origin_type": null,
    "origin_id": null,
    "ref": "SO2411-0003"
  }
]

Result of: GET http://dolibarr_ip/dolibarr/api/index.php/orders/5

{
  "module": null,
  "id": "5",
  "entity": "1",
  "import_key": null,
  "array_options": [],
  "array_languages": null,
  "contacts_ids": [],
  "linkedObjectsIds": {
    "shipping": {
      "3": "3"
    }
  },
  "canvas": null,
  "fk_project": null,
  "contact_id": null,
  "user": null,
  "origin_type": null,
  "origin_id": null,
  "ref": "SO2411-0003"
  }
]

Attached files

No response