diff --git a/app/plugins/Transmogrify/config/schema/tables.json b/app/plugins/Transmogrify/config/schema/tables.json index 79945351..98780b17 100644 --- a/app/plugins/Transmogrify/config/schema/tables.json +++ b/app/plugins/Transmogrify/config/schema/tables.json @@ -222,7 +222,7 @@ "postRow": "mapExternalIdentityToExternalIdentityRole", "fieldMap": { "co_id": null, - "person_id": "&mapOrgIdentitycoPersonId", + "person_id": "&mapOrgIdentityCoPersonId", "org_identity_id": "external_identity_id", "title": null, "o": null, @@ -433,12 +433,68 @@ "org_identity_id": "external_identity_id" } }, + "enrollment_flows": { + "source": "cm_co_enrollment_flows", + "displayField": "name", + "booleans": [ + "collect_enrollee_email" + ], + "cache": ["co_id", "auth_cou_id", "authz_co_group_id"], + "postRow": null, + "fieldMap": { + "authz_level": "authz_type", + "authz_co_group_id": "authz_group_id", + "my_identity_shortcut": null, + "match_policy": null, + "match_server_id": null, + "enable_person_find": null, + "approval_required": null, + "approver_co_group_id": null, + "approval_confirmation_mode": null, + "approval_require_comment": null, + "verify_email": null, + "email_verification_mode": null, + "invitation_validity": null, + "regenerate_expired_verification": null, + "require_authn": null, + "notification_co_group_id": "notification_group_id", + "status": "=S", + "notify_from": null, + "verification_subject": null, + "verification_body": null, + "verification_template_id": null, + "request_vetting": null, + "notify_on_approval": null, + "approval_subject": null, + "approval_body": null, + "approval_template_id": "notification_message_template_id", + "approver_template_id": null, + "denial_template_id": null, + "notify_on_finalize": null, + "finalization_template_id": "finalization_message_template_id", + "introduction_text": null, + "conclusion_text": null, + "introduction_text_pa": null, + "t_and_c_mode": null, + "redirect_on_submit": null, + "redirect_on_confirm": null, + "redirect_on_finalize": "redirect_on_finalize", + "return_url_allowlist": null, + "ignore_authoritative": null, + "duplicate_mode": null, + "co_theme_id": null, + "theme_stacking": null, + "establish_authenticators": null, + "establish_cluster_accounts": null, + "co_enrollment_flow_id": "enrollment_flow_id" + } + }, "petitions": { "source": "cm_co_petitions", "displayField": "authenticated_identifier", "canSkip": "true", "fieldMap": { - "co_enrollment_flow_id": null, + "co_enrollment_flow_id": "enrollment_flow_id", "co_id": null, "cou_id": "cou_id", "status": "&mapPetitionStatus", diff --git a/app/plugins/Transmogrify/src/Lib/Traits/RowTransformationTrait.php b/app/plugins/Transmogrify/src/Lib/Traits/RowTransformationTrait.php index dd7d1194..5aae0fe2 100644 --- a/app/plugins/Transmogrify/src/Lib/Traits/RowTransformationTrait.php +++ b/app/plugins/Transmogrify/src/Lib/Traits/RowTransformationTrait.php @@ -244,6 +244,9 @@ protected function mapLegacyFieldNames(string $table, array &$row): void // Default value mapping: set only if current value is null $first === '?' => $this->applyDefaultIfNull($row, $oldname, substr((string)$newname, 1)), + // Default value mapping: force set the value to the current value + $first === '=' => $row[$oldname] = substr((string)$newname, 1), + // Direct rename: copy to new name and unset the old one default => $this->renameField($row, $oldname, (string)$newname), }; @@ -352,7 +355,7 @@ protected function mapExternalIdentityToExternalIdentityRole(array $origRow, arr $roleRow[$newKey] = $origRow[$oldKey]; } - // Rationale: mapOrgIdentitycoPersonId accepts only the first mapping it finds + // Rationale: mapOrgIdentityCoPersonId accepts only the first mapping it finds // (later mappings are treated as legacy/unpooled anomalies and ignored). // Therefore, each ExternalIdentity produces at most one ExternalIdentityRole. // To avoid inserting a bogus self-referential changelog link, do not carry any diff --git a/app/plugins/Transmogrify/src/Lib/Traits/TypeMapperTrait.php b/app/plugins/Transmogrify/src/Lib/Traits/TypeMapperTrait.php index 952414f6..b49592e9 100644 --- a/app/plugins/Transmogrify/src/Lib/Traits/TypeMapperTrait.php +++ b/app/plugins/Transmogrify/src/Lib/Traits/TypeMapperTrait.php @@ -264,9 +264,9 @@ protected function mapLoginIdentifiers(array $origRow, array &$row): void { // (ie: $row) untouched $copiedRow = [ - 'person_id' => $this->map_org_identity_co_person_id(['id' => $origRow['org_identity_id']]), + 'person_id' => $this->mapOrgIdentityCoPersonId(['id' => $origRow['org_identity_id']]), 'identifier' => $origRow['identifier'], - 'type_id' => $this->map_identifier_type($origRow), + 'type_id' => $this->mapIdentifierType($origRow), 'status' => $origRow['status'], 'login' => true, 'created' => $origRow['created'], @@ -274,8 +274,8 @@ protected function mapLoginIdentifiers(array $origRow, array &$row): void { ]; // Set up changelog and fix booleans - $this->fixChangelog('identifiers', $copiedRow, true); - $this->fixBooleans('identifiers', $copiedRow); + $this->populateChangelogDefaults('identifiers', $copiedRow, true); + $this->normalizeBooleanFieldsForDb('identifiers', $copiedRow); try { $tableName = 'identifiers'; @@ -325,7 +325,7 @@ protected function mapNow(array $row) { * @throws Exception * @since COmanage Registry v5.0.0 */ - protected function mapOrgIdentitycoPersonId(array $row): ?int + protected function mapOrgIdentityCoPersonId(array $row): ?int { // PE eliminates OrgIdentityLink, so we need to map each Org Identity to // a Person ID. Historically, an Org Identity could have been relinked and