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.53k stars 2.81k forks source link

Create or edit Task in Project (v20) #31238

Closed funsurfer2008 closed 1 month ago

funsurfer2008 commented 2 months ago

Bug

If i want to create a Task or edit a existing one ill get the following Error:

Error in request SELECT rowid as rowid, ref, label FROM llx_product AND Filter error - Bad syntax of the search string ORDER BY ref, label 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 'AND Filter error - Bad syntax of the search string ORDER BY ref, label' at line 1. Check setup of extra parameters.

And the services for billing is empty.

brgds

Dolibarr Version

20.0.0

Environment PHP

8.x

Environment Database

MariaDB 10.6

Steps to reproduce the behavior and expected behavior

No response

Attached files

No response

funsurfer2008 commented 1 month ago

Any fast Fix? brgds

funsurfer2008 commented 1 month ago

updated to v20.0.1 -> same error!

vsatmydynipnet commented 1 month ago

running into the same after 19.0.2 -> 20.0.1 . this is really critical.

vsatmydynipnet commented 1 month ago

Found in the logs:

2024-10-09 13:50:53 ERR 192.168.2.2 3563 33 DoliDBMysqli::query SQL Error message: DB_ERROR_SYNTAX 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 'as status ORDER BY p.ref DESC LIMIT 51' at line 1 From /var/www/VHOST/projet/tasks/list.php:578.

2024-10-09 13:50:53 ERR 192.168.2.2 3563 33 Error url=/projet/tasks/list.php?leftmenu=tasks, query_string=leftmenu=tasks, sql=SELECT DISTINCT p.rowid as projectid, p.ref as projectref, p.title as projecttitle, p.fk_statut as projectstatus, p.datee as projectdatee, p.fk_opp_status, p.public, p.fk_user_creat as projectusercreate, p.usage_bill_time, s.nom as name, s.name_alias as alias, s.rowid as socid, t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_modification, t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut as status, t.description, t.fk_task_parent, t.budget_amount , SUM(tt.element_duration (CASE WHEN invoice_id IS NULL THEN 1 ELSE 0 END)) as tobill, SUM(tt.element_duration (CASE WHEN invoice_id IS NULL THEN 0 ELSE 1 END)) as billed FROM llx_projet as p LEFT JOIN llx_societe as s on p.fk_soc = s.rowid, llx_projet_task as t LEFT JOIN llx_element_time as tt ON (tt.fk_element = t.rowid AND tt.elementtype = 'task') WHERE t.fk_projet = p.rowid AND p.entity IN (1) AND p.fk_statut = 1 GROUP BY p.rowid, p.ref, p.title, p.fk_statut, p.datee, p.fk_opp_status, p.public, p.fk_user_creat, s.nom, s.rowid, t.datec, t.dateo, t.datee, t.tms, t.rowid, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress,t.budget_amount, t.fk_statut as status ORDER BY p.ref DESC LIMIT 51, db_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 'as status ORDER BY p.ref DESC LIMIT 51' at line 1

vsatmydynipnet commented 1 month ago

Fix for me:

--- list.php.ORIG       2024-10-09 16:26:05.256000000 +0200
+++ list.php.01.KMJ     2024-10-09 16:27:01.540000000 +0200
@@ -539,7 +539,7 @@
        $sql .= " GROUP BY p.rowid, p.ref, p.title, p.fk_statut, p.datee, p.fk_opp_status, p.public, p.fk_user_creat,";
        $sql .= " s.nom, s.rowid,";
        $sql .= " t.datec, t.dateo, t.datee, t.tms,";
-       $sql .= " t.rowid, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress,t.budget_amount, t.fk_statut as status";
+       $sql .= " t.rowid, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress,t.budget_amount, t.fk_statut";
        // Add fields from extrafields
        if (!empty($extrafields->attributes[$object->table_element]['label'])) {
                foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {

let the task list, create and edit make work.

funsurfer2008 commented 1 month ago

I'm sorry but that is not my error. i dont have a error in the log file. i'll get a Error in the sql query

brgds

funsurfer2008 commented 1 month ago

I'll find out that it has to do with the extra fields in the projet module: If i activate timesheet the extrafield 1 is not working:

product:ref|label:rowid::tosell='1' AND fk_product_type='1'

maybe also an error like this BUG:

https://github.com/Dolibarr/dolibarr/issues/31253

and it is also in dropdown for default service in user card: https://erp.a-square.at/user/card.php

brgds

funsurfer2008 commented 1 month ago

Sorry my error is related to timesheet module, not dolibarr. Sorry