Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: possible inconsistency between llx_ecm_files and file system when BILL_SUPPLIER_VALIDATES changes ref #27008

Conversation

atm-florianm
Copy link
Contributor

FIX possible inconsistency

When you validate a supplier invoice, its ref changes and so does the name of the directory that stores attachments.

Currently, the renaming is using two variables: $this->newref and $newref.

  • $this->newref is used for the ECM renaming
  • $newref is used for the file system renaming.

Most of the time, both variable have the exact same value, so there is no problem, but if a module implementing the BILL_SUPPLIER_VALIDATE trigger changes $this->newref, we end up with entries in llx_ecm_files with wrong paths because the actual file system renaming will use $newref, which the trigger cannot modify.

This fix ensures we use only $this->newref so that no inconsistency arises between ECM files and file system and enables triggers to modify the invoice's ref without “losing” its attachments.

…gger but we still use a local variable for the filesystem-based renaming
@eldy eldy merged commit bde53b1 into Dolibarr:17.0 Dec 12, 2023
2 checks passed
@atm-florianm atm-florianm deleted the FIX_17_trigger_BILL_SUPPLIER_VALIDATE_cannot_modify_newref branch December 13, 2023 09:46
atm-florianm added a commit to ATM-Consulting/dolibarr that referenced this pull request Mar 7, 2024
…ding to inconsistencies if BILL_SUPPLIER_VALIDATE changes the invoice's ref

this is a follow-up of PR Dolibarr#27008
atm-florianm added a commit to ATM-Consulting/dolibarr that referenced this pull request Mar 7, 2024
…ding to inconsistencies if BILL_SUPPLIER_VALIDATE changes the invoice's ref

this is a follow-up of PR Dolibarr#27008
eldy pushed a commit that referenced this pull request Mar 7, 2024
…ding to inconsistencies if BILL_SUPPLIER_VALIDATE changes the invoice's ref (#28684)

this is a follow-up of PR #27008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants