A CSV, TSV or Excel import now shows which column is which card field
before importing, pre-filled from the header names - English names and
WeKan's own export column names in every language - and asks for what is
missing: a file with no list column gets one list, named on the page,
instead of one list per row. Unused columns can be kept as text custom
fields. The choice goes to the server as csvMapping, checked before
anything is written, and the REST import and api.py take one too.
The Owner column is applied, as are swimlane, received date, parent card,
spent time, overtime and archived. A TSV value containing a comma stays one
value. A dropdown custom field value that is not one of its items is skipped
instead of failing the import.
An Excel workbook is read sheet by sheet, its header found in row 1 or where
WeKan's export puts it, in any language; formula cells are read as their
results and rich text as text. WeKan's own Excel export imports, and a
workbook with many boards - each on its own sheet, as Export all boards
writes it - imports as many boards; the Activity sheet is skipped.
Thanks to xet7 !
Fix TypeError: string.toLowerCase is not a function server unhandledRejections
reported in production. The registration invitation-code check in
Users.after.insert() read doc.authenticationMethod.toLowerCase() unguarded,
but authenticationMethod is only set for oauth2/ldap signups - a normal
password/invitation signup left it undefined and crashed this hook on every
insert whenever disableRegistration was on; doc.emails[0].address was also
read unguarded. The buffered notification-email sender likewise read
user.emails[0].address.toLowerCase() unguarded, crashing when a user (e.g. a
header-auth/LDAP account) has an empty emails array. The CSV/TSV importer's
header-row mapping read headerRow[i].toLowerCase() unguarded, which could
throw on a sparse row cell that isn't a string.
A full audit of every server-reachable .toLowerCase() call site (server/,
models/, packages/) found the rest already guarded (typeof checks, ||
'' fallbacks, or values sourced from validated schema fields).
Thanks to xet7 !
Following the JSON-export truncation report, every IMPORT source was
audited end-to-end the same way the export side already was: WeKan JSON,
WeKan zip, Trello JSON/API/zip, CSV/TSV, Excel, Jira, Kanboard, Markdown,
NextCloud Deck/OpenProject/GitHub/GitLab/Gitea/Forgejo/Asana/Zenkit, and
ICS. Every one of them is genuinely reachable from the UI and produces a
real board - no dead popups, no "Mapper"-only stubs. The WeKan JSON
round-trip (models/wekanCreator.js) restores swimlanes, lists, cards,
checklists, labels and custom fields without dropping any of them, and
attachment import already works both from inline base64 content and from
a bare URL reference (models/wekanCreator.js), so it needs no inline
attachment bytes and is unaffected by the export side now omitting them.
The one real historical bug found in this area, attachments always
empty in JSON export, was already fixed (commit 643e2738b) and is
unrelated to import.
The only genuine gap was test coverage: CSV, Jira and Kanboard import had
real, working parsers but no dedicated tests. This adds
tests/csvCreator.headerMapping.test.cjs, mirroring
CsvCreator#mapHeadertoCardFieldIndex (standard headers, aliases, and the
customfield-<name>-<type>-<extra> dropdown/dropdownMultiSelect/currency/
plain variants), and tests/kanboardJiraCreator.import.test.cjs, mirroring
KanboardCreator's unix-timestamp date parsing and column/swimlane
derivation, plus JiraCreator's issue-link-to-card-dependency mapping
(blocks/is-blocked-by/related-to, unknown targets, self-links and
duplicate links). Both modules import Meteor/model code and can't run
under plain Node, so the tests re-implement the exact production logic
as a faithful copy, following the existing convention in
tests/trelloCreator.import.test.js and the wekanCreator.*.test.js suite.
Thanks to xet7 !