Project task - time spent shows sql error after 23.04 upgrade

Hi. I upgraded from 23.03 to 23.04 and are now getting sql error when I try to view the Time Spent hours.

Dolibarr has detected a technical error.
This information can be useful for diagnostic purposes (you can set option $dolibarr_main_prod to ‘1’ to hide sensitive information):
Date: 20260904152341
Dolibarr: 23.0.4 - https://www.dolibarr.org
Level of features: 0
Login: user
PHP: 8.3.33
Server: Apache
OS: Linux cpanel66.proisp.no 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36

Requested URL: /dolibarr/projet/tasks/time.php?id=35&withproject=1
Referer: Login @ 23.0.4
Menu manager: eldy_menu.php

Modules/Applications: syslog, user, workflow, import, cron, commande, ecm, expensereport, facture, fournisseur, ficheinter, printing, modulebuilder, resource, service, societe, variants, product, projet, bookmark, export, oauth, emailcollector, categorie, fckeditor, blockedlog, propal, contrat, expedition, stock
Database type manager: mysqli
Latest database access request error: SELECT t.rowid, t.fk_element, t.element_date, t.element_datehour, t.element_date_withhour, t.element_duration, t.fk_user, t.note, t.thm, t.fk_product, t.invoice_line_id, pt.rowid as taskid, pt.ref, pt.label, pt.fk_projet, pt.billable u.lastname, u.firstname, u.login, u.photo, u.gender, u.statut as user_status, il.fk_facture as invoice_id, inv.fk_statut, p.fk_soc,s.name_alias FROM llxom_element_time as t LEFT JOIN llxom_facturedet as il ON il.rowid = t.invoice_line_id LEFT JOIN llxom_facture as inv ON inv.rowid = il.fk_facture LEFT JOIN llxom_product as prod ON prod.rowid = t.fk_product INNER JOIN llxom_projet_task as pt ON pt.rowid = t.fk_element LEFT JOIN llxom_projet_task_extrafields as efpt ON pt.rowid = efpt.fk_object INNER JOIN llxom_projet as p ON p.rowid = pt.fk_projet INNER JOIN llxom_user as u ON t.fk_user = u.rowid LEFT JOIN llxom_societe as s ON s.rowid = p.fk_soc WHERE elementtype = ‘task’ AND p.entity IN (1) AND t.fk_element =35 ORDER BY t.element_date DESC, t.element_datehour DESC, t.rowid DESC LIMIT 26
Return code for latest database access request error: DB_ERROR_SYNTAX
Information for latest database access request error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘.lastname, u.firstname, u.login, u.photo, u.gender, u.statut as user_status, …’ at line 1

Is this a bug in Dolibarr or could it be an error with DB Collation settings. I have run the same setup since version 6 :upside_down_face: ..

Steps to reproduce the problem (on 23.04)
1 create project
2 create task
3 input hours on the task and save (it saves correctly).
4 go to Project - chose Task in upper menu and on the menu below you will see “Time Spent”. When I press this I get the SQL error.

could be a table or column is missing - just give it a try to deactivate and reactivate the Project Module.

Ok. Thanks for tips Kim! I will tried but the same issue appeared.

I think I will rollback to my backup at the start of the month.

I run 24.0.0 - maybe you should try upgrading to that.

My AI says that there is an error in the SQL

The error is a missing comma in the SELECT list:

pt.billable u.lastname, u.firstname, u.login, u.photo, u.gender,
u.statut as user_status, ...

There should be a comma between pt.billable and u.lastname:

pt.billable, u.lastname, u.firstname, u.login, u.photo, u.gender,
u.statut as user_status, ...

Why the error message looks the way it does: Without the comma, MariaDB interprets u as a table alias for pt.billable (i.e., pt.billable AS u). Then it hits .lastname, which is invalid syntax at that point. That's why the error message points to '.lastname, u.firstname, u.login, ...' — the parser got confused right at the point where the missing comma breaks the statement.

If you edit this file htdocs/projet/tasks/time.php then it should just be as simple as adding a ,

it is reported here SQL error in /projet/tasks/time.php · Issue #39572 · Dolibarr/dolibarr · GitHub

fixed here Fix #39572 add missing comma before u.lastname in time list query by pixodeo · Pull Request #39579 · Dolibarr/dolibarr · GitHub

and here FIX : Repair broken SELECT of the time spent list by atm-jonathan · Pull Request #39609 · Dolibarr/dolibarr · GitHub

This should be released in 23.0.5 (if it comes)

Seems fixed in 24.0.0, at least I can load a project with no tasks and no time spent

I added the comma and now it works! Thanks for guiding me - you guys are great!