Module Adhérent (Membership management)

There is a bug since version 14.0.x with file attachments.
Error Duplicate entry ‘adherent/2430-myfile’ for key ‘uk_ecm_files’.

I traced it down to file /usr/share/dolibarr/adherents/card.php line 2006 : $filedir = $conf->adherent->dir_output.’/’.get_exdir(0, 0, 0, 0, $object, ‘member’);

For now I fixed the issue by changing $filedir = $conf->adherent->dir_output.’/’.get_exdir(0, 0, 0, 1, $object, ‘member’);
This fix removes the “/” at the end of the string.

In file files.lib.php, function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir) does not receive correct $relativedir.
So, the system want to cre-create the record(s).

Many thanks for taking care of a fix in 14.0.2.

Hello,

Can you post it on GitHub ?