When adding a contact, the third-party list only shows lines

In the Contacts tab of a proposal, an order or a project, the third-party search only offers empty lines. A bug in 24.0.0 and 24.0.1 when third-party search by typing is enabled.

Versions concerned
Dolibarr 24.0.0 and 24.0.1, with third-party search by typing · 23 not affected · fixed in the 24.0.2 code (not yet announced on 4 October 2026)
What was checked
Tested on 4 October 2026 on new 24.0.1 and 23.0.4 instances, without any external module: original setting, classic list correct; search by typing enabled through the screen, lines in the Contacts tab of the proposal, the order and the project in 24.0.1, correct list in 23.0.4; SQL error recorded in the database; swapping the two lines tested, then the official 24.0.2 file tested. File societe/ajax/ajaxcompanies.php compared in the official code in 20.0.4, 23.0.4, 24.0.0, 24.0.1 and 24.0.2. Fix listed in the official 24.0.2 changelog (no. 40277).

You open the Contacts/Addresses tab of a proposal, an order or a project. To add an external contact, you start typing the third party’s name. Instead of the list of third parties, you get a few horizontal lines, without any name. Impossible to choose the third party.

It is not your installation. It is a bug in versions 24.0.0 and 24.0.1. Version 23 is not affected.

Who is affected

Only if third-party search by typing is enabled: in the Third parties module setup, the setting “Wait until a key is pressed before loading content of Third Parties combo list” is set to “Yes”. The Third party field is then a box you type into. If you see a classic drop-down list instead, you are not affected: that is the setting of a new installation.

The cause

The search by typing queries a small server script, which returns the third parties whose name matches. In 24.0.0, the query of this script was changed: the limit on the number of results was placed before the sorting, whereas SQL requires it after. The database therefore rejects the query, every time.

The script then returns an error response. The browser tries to display it as a list of third parties, and produces lines without text: those are your lines.

The solutions

  1. Dolibarr’s fix. It is in the 24.0.2 code (no. 40277 in the changelog): the sorting is put back before the limit. On 4 October 2026, 24.0.2 can be downloaded from SourceForge since 2 October, but it is not yet announced on dolibarr.org and there is no Docker image yet.

  2. Swap two lines in societe/ajax/ajaxcompanies.php, around line 143. Back up the original file, then make sure these two lines appear only once, in this order:

    $sql .= " ORDER BY s.nom ASC";
    $sql .= $db->plimit($limit, 0);
  3. Go back to the classic list, without touching the code: set the search-by-typing setting back to “No” in the Third parties module setup.

How this was verified

  • On a new 24.0.1 instance, without any external module: with the original setting, the classic list is correct. Search by typing enabled: lines in the Contacts tab of the proposal, the order and the project. The database returns a syntax error on LIMIT 1000 ORDER BY.
  • With the two lines swapped, then with the official 24.0.2 file instead: the list of third parties comes back.
  • On a 23.0.4 instance, with search by typing: correct list.
  • In the official code: in 20.0.4 and 23.0.4, the query has no limit; in 24.0.0 and 24.0.1, the limit is placed before the sorting; in 24.0.2, it is placed after.

Before moving to 24, the checklist in Dolibarr upgrade: checklist and upgrade path still applies.

If the list stays empty

If the list stays empty after the fix, the cause is elsewhere. The €90 diagnosis is about looking at your instance with you for one hour, then giving you in writing the cause and what the fix would cost.

Dolibarr24contactsthird partyautocompleteempty listajaxcompanies