You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think would have a bug for invoices (error message appears for customer but not for vendor).
When I delete an invoice which have some linked files, this files are deleted from HDD but not deleted in database (table 'llx_ecm_files').
Environment
Version: [12.0.1 (from 11.0.3)]
OS: [Local hosting on Windows 10 version 2004 (10.0.19041.388)]
Problem replicate on Dolbarr demo website (12.0.0)
Steps to reproduce the behavior
Make a customer draft invoice
Add a linked file (here 'Liste client - 2020-07-26.xlsx')
Add a line in card
Validate invoice (here ref 'FA2008-0001')
Delete invoice
Make a customer draft invoice
Add the same linked file as in step 2
Add a line in card
Validate invoice
--> If the generated invoice ref is the same as in step 4 (no other customer invoice between time), the validating is canceled by this message error : "Duplicate entry 'facture/FA2008-0001-FA2008-0001-Liste client - 2020-07-26.xlsx-1' for key 'uk_ecm_files'"
Expected and actual behavior
I think than the problem is in step 5, the invoice deleting delete the files in HDD, but in database, just the line of generated PDF file of customer invoice is deleted, but not the line of linked file (same problem with many linked files).
So with the customer invoice validating at the step 9, when the files must be renamed (PROV... to FA2008-0001...), an error appears because the linked file for this customer invoice ref already exist in database, because the 'uk_ecm_files' index wich contains columns 'filepath', 'filename' and 'entity' of 'llx_ecm_files' table must be unique.
Note 1 : I tried with different files and I have the same problem.
Note 2 : When I delete by hand the linked file one by one with the trash icon (in tab Card or in tab Linked file), this is OK, the file is deleted in HDD and in database
Note 3 : For a vendor invoice, there isn't have error message, the validating of invoice in step 9 is OK, but it's because the file path format is different between a customer invoice and a vendor invoice ("facture/FA2008-0001" for customer, "fournisseur/facture/1/0/SI2008-0001" for first invoice vendor, and "fournisseur/facture/2/0/SI2008-0001" for the second).
I looked the Dolibarr php files and I found this :
File 'core\lib\files.lib.php', line 1233, function 'delete' called in file 'ecm\class\ecmfiles.class.php' : $result = $ecmfile->delete($user);
--> bug in 'foreach' loop, or in 'if' ? so the function 'delete' for SQL request DELETE of linked files isn't called ?
Here the part of log for the 'delete' action of customer invoice (step 5). We can see than the SQL request DELETE in table 'llx_ecm_files' is only for one line, that of PDF file generated for the customer invoice), but the linked file is deleted in HDD : https://textup.fr/475576zp
Sorry for my bad english.
Kevin
Attached files
Error message (step 9) :
The text was updated successfully, but these errors were encountered:
Bug
I think would have a bug for invoices (error message appears for customer but not for vendor).
When I delete an invoice which have some linked files, this files are deleted from HDD but not deleted in database (table 'llx_ecm_files').
Environment
Steps to reproduce the behavior
--> If the generated invoice ref is the same as in step 4 (no other customer invoice between time), the validating is canceled by this message error : "Duplicate entry 'facture/FA2008-0001-FA2008-0001-Liste client - 2020-07-26.xlsx-1' for key 'uk_ecm_files'"
Expected and actual behavior
I think than the problem is in step 5, the invoice deleting delete the files in HDD, but in database, just the line of generated PDF file of customer invoice is deleted, but not the line of linked file (same problem with many linked files).
So with the customer invoice validating at the step 9, when the files must be renamed (PROV... to FA2008-0001...), an error appears because the linked file for this customer invoice ref already exist in database, because the 'uk_ecm_files' index wich contains columns 'filepath', 'filename' and 'entity' of 'llx_ecm_files' table must be unique.
Note 1 : I tried with different files and I have the same problem.
Note 2 : When I delete by hand the linked file one by one with the trash icon (in tab Card or in tab Linked file), this is OK, the file is deleted in HDD and in database
Note 3 : For a vendor invoice, there isn't have error message, the validating of invoice in step 9 is OK, but it's because the file path format is different between a customer invoice and a vendor invoice ("facture/FA2008-0001" for customer, "fournisseur/facture/1/0/SI2008-0001" for first invoice vendor, and "fournisseur/facture/2/0/SI2008-0001" for the second).
I looked the Dolibarr php files and I found this :
File 'core\lib\files.lib.php', line 1233, function 'delete' called in file 'ecm\class\ecmfiles.class.php' :
$result = $ecmfile->delete($user);
--> bug in 'foreach' loop, or in 'if' ? so the function 'delete' for SQL request DELETE of linked files isn't called ?
Here the part of log for the 'delete' action of customer invoice (step 5). We can see than the SQL request DELETE in table 'llx_ecm_files' is only for one line, that of PDF file generated for the customer invoice), but the linked file is deleted in HDD :
https://textup.fr/475576zp
Sorry for my bad english.
Kevin
Attached files
Error message (step 9) :
The text was updated successfully, but these errors were encountered: