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
Duplicate members when importing a project from CSV #97
Comments
Was this fixed? Because I'm having this issue... |
Unfotunately not. My workaround was to edit the CSV with a texteditor like Notepad++ to have member namens without spaces and renaming them after import. |
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Hey there. Thanks for the bug report. It's now fixed. New release is coming soon. |
Hello @eneiluj, First of all, thank you very much for developing Cospend! Using v1.4.8 on Nextcloud 24, I noticed a similar bug with white-spaces following commas when the members are enumerated. Given the following example (line anonymized but structure copy-pasted from an exported CSV file)...
... the members Pierre, Paul and Jacques will be added twice when importing the CSV in Cospend (the first member of the enumeration, in this case Jean, is not duplicated). Remark: as a workaround, removing all the spaces after these commas using a text editor fixes the issue (this can be done rather quickly using the substitution Best regards. |
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
@falzonv Thanks for reporting this. Are you sure there are spaces following comas for the owers field in csv files produced by Cospend? There shouldn't be any. Anyway, the import process now trims each ower. This is available in latest nightly (v1.4.9-2-nightly). It would be nice if you could try it. |
Hello, You are right, actually the exports came from an older version of Cospend (yesterday I had to reinstall Nextcloud, looking at my DB backup it was Cospend 1.3.7 on Nextcloud 21). I noticed the bug when importing projects back in the new instance (*). (*) By the way, in my exports I also had some members with spaces in their name and those ones were properly imported so I can confirm that the original bug of this ticket is solved. Regarding testing, I would prefer to let my Nextcloud instance on the stable channel. Best regards. |
Sorry, just found it at the bottom of the README... |
I was able to test version 1.4.9-2 but unfortunately the fix doesn't seem to work properly:
Here is an example file that I just created and where I added spaces like in the older exports, if you want to test: |
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
@falzonv Thanks for the precise feedback. Yeah right I didn't test my fix. It's now properly fixed and available in v1.4.9-3-nightly. |
Hello @eneiluj, Just checked with v1.4.9-3 and indeed the issue is solved, thank you very much! Best regards. |
@falzonv Nice! Thanks for testing it. Closing this, feel free to reopen if needed. |
I just noticed that there is a bug regarding the CSV import when you have members containing a blank. The import strips the whitespaces resulting in duplicate members and incorrect balances.
Example: You have a project with members "John Doe" and "Jane Doe". After importing this project from CSV you have the four members "John Doe", "Jane Doe", "JohnDoe" and "JaneDoe".
I had a quick look at the code and noticed the following line. This replaces all whitespaces from the
owners
CSV column, which is probably the reason for the error. https://github.com/eneiluj/cospend-nc/blob/d24998d591403f67ddf68ee3e833208dcf622885/lib/Service/ProjectService.php#L5401EDIT:
The text was updated successfully, but these errors were encountered: