mirror of
https://github.com/wekan/wekan.git
synced 2026-11-05 09:40:20 -05:00
A) Import "map members": clicking a searched user threw `TypeError: Cannot read properties of undefined (reading '_id')` at `click .js-select-import`. The handler read `Template.currentData()._id`, which is undefined when the click lands on a CHILD of the anchor (the avatar or the name span). Read the WeKan user id from the anchor's `data-id` (event.currentTarget) instead, and guard it — robust regardless of which inner node was clicked. B) Admin Panel / People: saving an IMPORTED (placeholder) user as an active person with an email threw `TypeError: Cannot read properties of undefined (reading '0')`. The profile submit handler read `user.emails[0].verified` (and `.address`), but an imported placeholder user (and some SSO users) have no `emails` array at all. Read the primary email defensively (missing OR empty array) via a `primaryEmail` guard. Tests: tests/importMapUserFixes.test.cjs; tests/importMemberMapping.test.cjs updated for the data-id mapping. Thanks to AmigaAbattoir and xet7 ! Fixes #6508,