dolibarr_project_timesheet icon indicating copy to clipboard operation
dolibarr_project_timesheet copied to clipboard

Error on Dolibarr 18 beta

Open funsurfer2008 opened this issue 1 year ago • 34 comments

Hy,

i have updated to dolibarr 18 beta yesterday and i become this error on Projectreportpage:

Datum: 20230627155546 Dolibarr: 18.0.0-beta - https://www.dolibarr.org Funktionslevel: 0 PHP: 8.0.28 Server: Apache/2.4.56 (Debian) mod_fcgid/2.3.9 OpenSSL/1.1.1n OS: Linux srv04.ms-hosting.local 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.58

Angefragte URL: /custom/timesheet/TimesheetReportProject.php?projectSelected=18 Referer: https://XXXXXXXXXXXXXX/projet/tasks/time.php?withproject=1&projectid=18 Menüverwaltung: eldy_menu.php

Module/Anwendungen: user, knowledgemanagement, prelevement, projet, categorie, import, export, workflow, bookmark, propal, contrat, timesheet, taskgantt, product, accounting, agenda, banque, cron, commande, ecm, expensereport, facture, fournisseur, margin, opensurvey, resource, salaries, service, societe, ticket, supplier_proposal, reception, tax, paymentbybanktransfer Datenbank Type Manager: mysqli Letzter Fehlerhafter Datenbankzugriff: SELECT tsk.fk_projet as projectid, ptt.fk_user as userid, tsk.rowid as taskid, (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced, ptt.rowid as id, ptt.note as note, tske.invoiceable as invoicable, DATE(ptt.task_datehour) AS task_date, ptt.task_duration as duration FROM llx_projet_task_time as ptt JOIN llx_projet_task as tsk ON tsk.rowid = fk_task LEFT JOIN llx_projet_task_extrafields as tske ON tske.fk_object = fk_task WHERE tsk.fk_projet IN ('18') AND DATE(task_datehour) >= '2023-06-27 15:55:46' AND DATE(task_datehour) <= '2023-06-27 15:55:46' AND (ptt.task_duration > 0 or LENGTH(ptt.note)>0) ORDER BY tsk.fk_projet,ptt.fk_user, tsk.rowid, DATE(ptt.task_datehour) ASC Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_NOSUCHTABLE Information zum letzten fehlerhaften Datenbankzugriff: Table 'DATABASE.llx_projet_task_time' doesn't exist

could you please check?

brgds

funsurfer2008 avatar Jun 27 '23 14:06 funsurfer2008

this errors means you have no llx_projet_task_time table in your dolibarr. add the table should fix the problem for you.

CREATE TABLE llx_projet_task_time (....

tronx2100 avatar Jun 27 '23 18:06 tronx2100

Yes, but why do i Not have the table Since Update to v18?

funsurfer2008 avatar Jun 27 '23 20:06 funsurfer2008

in dolibarr v17 you have the table inside the install directory https://github.com/Dolibarr/dolibarr/tree/17.0/htdocs/install/mysql

but you are right llx_projet_task_time is in v18 not in the install/mysql directory... maybe because v18 is beta or ask the dolibarr team whats happen with the table in v18 is a BUG report related to this https://github.com/Dolibarr/dolibarr/issues/24464

what i can say is in v18 the table name seems to be changed https://github.com/Dolibarr/dolibarr/commit/97344e38cbd0d7d47b5e9000d9534995a2c33f44

so we need to check this to make it working again on v18

tronx2100 avatar Jun 27 '23 21:06 tronx2100

i have build a quick realease with renamed tables please download the attached file and rename to zip maybe it works.please send a feedback. it is pre alpha :)

module_timesheet-4.6.7.zip_v18.alpha.txt

tronx2100 avatar Jun 27 '23 21:06 tronx2100

now i become:

Datenbank Type Manager: mysqli Letzter Fehlerhafter Datenbankzugriff: SELECT tsk.fk_projet as projectid, ptt.fk_user as userid, tsk.rowid as taskid, (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced, ptt.rowid as id, ptt.note as note, tske.invoiceable as invoicable, DATE(ptt.task_datehour) AS task_date, ptt.task_duration as duration FROM llx_element_time as ptt JOIN llx_projet_task as tsk ON tsk.rowid = fk_task LEFT JOIN llx_projet_task_extrafields as tske ON tske.fk_object = fk_task WHERE tsk.fk_projet IN ('18') AND DATE(task_datehour) >= '2023-06-28 21:53:33' AND DATE(task_datehour) <= '2023-06-28 21:53:33' AND (ptt.task_duration > 0 or LENGTH(ptt.note)>0) ORDER BY tsk.fk_projet,ptt.fk_user, tsk.rowid, DATE(ptt.task_datehour) ASC Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_NOSUCHFIELD Information zum letzten fehlerhaften Datenbankzugriff: Unknown column 'ptt.task_datehour' in 'field list'

funsurfer2008 avatar Jun 28 '23 19:06 funsurfer2008

ok

now i become:

Datenbank Type Manager: mysqli Letzter Fehlerhafter Datenbankzugriff: SELECT tsk.fk_projet as projectid, ptt.fk_user as userid, tsk.rowid as taskid, (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced, ptt.rowid as id, ptt.note as note, tske.invoiceable as invoicable, DATE(ptt.task_datehour) AS task_date, ptt.task_duration as duration FROM llx_element_time as ptt JOIN llx_projet_task as tsk ON tsk.rowid = fk_task LEFT JOIN llx_projet_task_extrafields as tske ON tske.fk_object = fk_task WHERE tsk.fk_projet IN ('18') AND DATE(task_datehour) >= '2023-06-28 21:53:33' AND DATE(task_datehour) <= '2023-06-28 21:53:33' AND (ptt.task_duration > 0 or LENGTH(ptt.note)>0) ORDER BY tsk.fk_projet,ptt.fk_user, tsk.rowid, DATE(ptt.task_datehour) ASC Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_NOSUCHFIELD Information zum letzten fehlerhaften Datenbankzugriff: Unknown column 'ptt.task_datehour' in 'field list'

okay a lot of changes ... i have made a new build with renamed a lot more fieldnames

maybe it works now

try it

module_timesheet-4.6.7.zip_v18ALPHA2.txt

tronx2100 avatar Jun 28 '23 20:06 tronx2100

^nope sorry: Module/Anwendungen: user, knowledgemanagement, prelevement, projet, categorie, import, export, workflow, bookmark, propal, contrat, timesheet, taskgantt, product, accounting, agenda, banque, cron, commande, ecm, expensereport, facture, fournisseur, margin, opensurvey, resource, salaries, service, societe, ticket, supplier_proposal, reception, tax, paymentbybanktransfer Datenbank Type Manager: mysqli Letzter Fehlerhafter Datenbankzugriff: SELECT tsk.fk_projet as projectid, ptt.fk_user as userid, tsk.rowid as taskid, (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced, ptt.rowid as id, ptt.note as note, tske.invoiceable as invoicable, DATE(ptt.element_datehour) AS element_date, ptt.element_duration as duration FROM llx_element_time as ptt JOIN llx_projet_task as tsk ON tsk.rowid = fk_task LEFT JOIN llx_projet_task_extrafields as tske ON tske.fk_object = fk_task WHERE tsk.fk_projet IN ('18') AND DATE(element_datehour) >= '2023-06-28 23:15:29' AND DATE(element_datehour) <= '2023-06-28 23:15:29' AND (ptt.element_duration > 0 or LENGTH(ptt.note)>0) ORDER BY tsk.fk_projet,ptt.fk_user, tsk.rowid, DATE(ptt.element_datehour) ASC Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_NOSUCHFIELD Information zum letzten fehlerhaften Datenbankzugriff: Unknown column 'fk_task' in 'on clause'

funsurfer2008 avatar Jun 28 '23 21:06 funsurfer2008

i have now replaced all fields from migration help https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/install/mysql/migration/17.0.0-18.0.0.sql

please try this build module_timesheet-4.6.7.zip_v18_alpha3.txt

tronx2100 avatar Jun 28 '23 22:06 tronx2100

hy. seems to work now. Thanks

funsurfer2008 avatar Jun 29 '23 08:06 funsurfer2008

Hy. Sorry, but it seems that it have more broken tables:

PHP: 8.0.28 Server: Apache/2.4.56 (Debian) mod_fcgid/2.3.9 OpenSSL/1.1.1n OS: Linux srv04.ms-hosting.local 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67

Angefragte URL: /custom/timesheet/TimesheetProjectInvoice.php?projectid=14 Referer: https://erp.a-square.at/projet/card.php?id=14&save_lastsearch_values=1 Menüverwaltung: eldy_menu.php

Module/Anwendungen: user, knowledgemanagement, prelevement, accounting, agenda, banque, cron, commande, ecm, expensereport, facture, fournisseur, margin, opensurvey, resource, salaries, service, societe, ticket, projet, categorie, import, export, workflow, bookmark, propal, contrat, timesheet, taskgantt, product, supplier_proposal, reception, tax, paymentbybanktransfer Datenbank Type Manager: mysqli Letzter Fehlerhafter Datenbankzugriff: SELECT s.rowid, s.nom as name, s.name_alias, s.tva_intra, s.client, s.fournisseur, s.code_client, s.code_fournisseur FROM llx_societe as s WHERE s.entity IN (1) AND (Filter syntax error - Bad syntax of the search string) ORDER BY nom ASC Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_SYNTAX Information zum letzten fehlerhaften Datenbankzugriff: 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 'syntax error - Bad syntax of the search string) ORDER BY nom ASC' at line 1

brgds

funsurfer2008 avatar Jul 04 '23 15:07 funsurfer2008

i'm not sure about this, because s.tva_intra and s.code_client is not used in timesheet maybe this shows other problems with dolibarr

tronx2100 avatar Jul 04 '23 16:07 tronx2100

ill think it looks for existing invoices from customers. maybe it is because v18 is in beta. there are other problems too.

lets look forward to release, and then fix it for good :)

funsurfer2008 avatar Jul 04 '23 16:07 funsurfer2008

Hy! 18.0.1 is out but timesheet does not work. can you fix it please? brgds

funsurfer2008 avatar Sep 11 '23 08:09 funsurfer2008

Hy. whats about an update for v18? brgds

funsurfer2008 avatar Sep 13 '23 11:09 funsurfer2008

Hi , i was busy last weeks because a lot of problems was to fix wicth php8.2.7.

im not ne Developer from this module but i hope my latest changes will fix it module_timesheet-4.6.7.zip.txt

we have it in use and it works. try it out

tronx2100 avatar Sep 15 '23 21:09 tronx2100

Hy. sorry, but i become this error:

Angefragte URL: /custom/timesheet/TimesheetProjectInvoice.php?projectid=14 Referer: https://erp.a-square.at/projet/card.php?id=14&save_lastsearch_values=1 Menüverwaltung: eldy_menu.php

Module/Anwendungen: user, knowledgemanagement, prelevement, projet, categorie, import, export, workflow, bookmark, propal, contrat, timesheet, taskgantt, product, accounting, agenda, banque, cron, commande, ecm, expensereport, facture, fournisseur, margin, opensurvey, resource, salaries, service, societe, ticket, supplier_proposal, reception, tax, paymentbybanktransfer Datenbank Type Manager: mysqli Letzter Fehlerhafter Datenbankzugriff: SELECT s.rowid, s.nom as name, s.name_alias, s.tva_intra, s.client, s.fournisseur, s.code_client, s.code_fournisseur FROM llx_societe as s WHERE s.entity IN (1) AND (Filter syntax error - Bad syntax of the search string) ORDER BY nom ASC Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_SYNTAX Information zum letzten fehlerhaften Datenbankzugriff: 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 'syntax error - Bad syntax of the search string) ORDER BY nom ASC' at line 1

funsurfer2008 avatar Sep 18 '23 05:09 funsurfer2008

Should now work

module_timesheet-4.6.7.zip.txt

tronx2100 avatar Sep 18 '23 11:09 tronx2100

Hy! perfect. seems to work! brgds

funsurfer2008 avatar Sep 18 '23 12:09 funsurfer2008

Well I didn't wanted to downgrade my instance because of this module, so @tronx2100 I tried your patch but this is not working with a psql backend, there are syntax errors when adding times.

@delcroip do you plan official support for v18 ?

vidlb avatar Oct 11 '23 16:10 vidlb

Hello, there is a branch dolibarr 18, did you try it ?

delcroip avatar Oct 11 '23 18:10 delcroip

I remember you once told me we have to get zips from sourceforge else it won't work. Is there a build for v18 somewhere ? How can I use that branch to deploy ? Can I just zip the branch and upload as it is to dolibarr apps installer ?
Or is there a php build something ^^ ?

vidlb avatar Oct 11 '23 18:10 vidlb

Hi, after checking the development branch, do the queries migration to fix all queries, but still had few issues, and oh magic, I discover the dolibarr-18 branch 🙄...

for dolibarr 18 with postgresql, in order to be able to create a time spent, I had to run those three adjustments:

CREATE SEQUENCE llx_element_time_rowid_seq;
ALTER SEQUENCE llx_element_time_rowid_seq OWNER TO dolibarr; -- or any user you use
SELECT setval('llx_element_time_rowid_seq', (SELECT max(rowid) FROM llx_element_time));
ALTER TABLE llx_element_time ALTER COLUMN rowid SET DEFAULT nextval('llx_element_time_rowid_seq'::regclass);

This issue is more on the dolibarr core (as they miss this in the migration 17 to 18 script so I will open a ticket on their side. @delcroip Can you confirm that it's not on the module?

matll42 avatar Oct 18 '23 03:10 matll42

You are right, those were not created by the module.

Br

delcroip avatar Oct 18 '23 04:10 delcroip

for dolibarr 18 with postgresql, in order to be able to create a time spent, I had to run those three adjustments:

Okay, what can I do now that I already applied migrations ? Can I just re-use the zip.txt @tronx2100 updated after running those sql commands ?

Also can someone explain how I can build the timesheet package using this v18 branch, or can I just upload the timesheet dir as it is in zip format ?

vidlb avatar Oct 18 '23 10:10 vidlb

@vidlb you can directly use the htdocs/timesheet folder inside of the module archive

This has been a long time since I created a module, but if you already apply the migrations, you can connect to pgsql to run the commands, and create a new time entry should work. I didn't use the zip, but directly the git branch.

matll42 avatar Oct 19 '23 02:10 matll42

the .txt file must be renamed to zip. The latest one is in daily use in our company and not reported any bugs. It is also working without errors on php 8.2.9

tronx2100 avatar Oct 19 '23 06:10 tronx2100

Using the branch dolibarr-18 and after I ran the missing index sql command, the app seems to work but failed to save new entries :

2023-10-19 08:09:19 ERR     193.48.189.250    DoliDBPgsql::query SQL Error query: INSERT INTO llx_element_time (import_key, fk_element, elementtype, element_date, element_datehour, element_date_withhour, element_duration, fk_product, fk_user, thm, invoice_id, invoice_line_id, intervention_id, intervention_line_id, datec, note) VALUES (NULL, 37, 'task', '2023-09-11 06:00:00', '2023-09-11 06:00:00', 1, 12600, NULL, 1, NULL, NULL, NULL, NULL, NULL, '2023-10-19 12:09:19', '')
2023-10-19 08:09:19 ERR     193.48.189.250    DoliDBPgsql::query SQL Error message: ERROR:  42501: permission denied for sequence llx_element_time_rowid_seq
LOCATION:  nextval_internal, sequence.c:616 (DB_ERROR_42501)
2023-10-19 08:09:19 ERR     193.48.189.250    DoliDBPgsql::query SQL Error usesavepoint = 0

Is it because I used the postgres user ? Do I need to grant privileges ?

vidlb avatar Oct 19 '23 08:10 vidlb

My bad, this is working after I used GRANT ALL ON llx_element_time_rowid_seq TO dolibarr ; Thank you guys

vidlb avatar Oct 19 '23 08:10 vidlb

yes if you use another user than the user from dolibarr, alternative is change the owner that is more apropriate to avoid multiple users defined on your db:

ALTER SEQUENCE llx_element_time_rowid_seq OWNER TO dolibarr; -- or any user you use

matll42 avatar Oct 20 '23 02:10 matll42

What is the final result here? I have version 4.6.7 installed on my Dolibarr server running 18.3. It is still throwing the error that projet_task_time is not found because according to the change log for v. 18.

NEW: element time integration code + SQL NEW: tables: llx_element_time to store time spent on several elements (mo, ticket...)

I am not adept enough at coding Dolibarr yet to make the required change. But after following this thread it looks like maybe the changes were made? Any help? Thanks!

whp-jeffm avatar Dec 14 '23 19:12 whp-jeffm