@@ -924,6 +924,7 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
924924 }
925925
926926 uploadResult . newName = transformedCardName ;
927+ uploadResult . actualName = transformedCard [ 'Name' ] ; // This is required as storage needs name without version, for replacement in other references
927928 if ( transformedCard [ 'Name' ] !== card [ 'Name' ] ) {
928929 uploadResult . warnings . unshift ( this . messages . getMessage ( 'cardNameChangeMessage' , [ transformedCardName ] ) ) ;
929930 }
@@ -989,6 +990,10 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
989990 if ( flexCardAssessmentInfo . errors && flexCardAssessmentInfo . errors . length > 0 ) {
990991 value . error = flexCardAssessmentInfo . errors ;
991992 value . migrationSuccess = false ;
993+ } else if ( flexCardAssessmentInfo . migrationStatus === 'Needs manual intervention' ) {
994+ // Duplicate name and other critical warnings
995+ value . error = flexCardAssessmentInfo . warnings ;
996+ value . migrationSuccess = false ;
992997 } else {
993998 value . migrationSuccess = true ;
994999 }
@@ -1048,15 +1053,21 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
10481053
10491054 const originalName : string = oldrecord [ 'Name' ] ;
10501055 let value : FlexcardStorage = {
1051- name : newrecord ?. newName ,
1056+ name : newrecord ?. actualName ,
10521057 isDuplicate : false ,
10531058 originalName : originalName ,
10541059 } ;
10551060
10561061 if ( newrecord === undefined ) {
1057- value . error = [ 'Migration Failed' ] ;
1062+ // Card was not migrated - check if original record has error details
1063+ if ( oldrecord [ 'errors' ] && Array . isArray ( oldrecord [ 'errors' ] ) ) {
1064+ value . error = oldrecord [ 'errors' ] ;
1065+ } else {
1066+ value . error = [ 'Migration Failed' ] ;
1067+ }
1068+ value . migrationSuccess = false ;
10581069 } else {
1059- if ( newrecord . hasErrors ) {
1070+ if ( newrecord . hasErrors || newrecord ?. success === false ) {
10601071 value . error = newrecord . errors ;
10611072 value . migrationSuccess = false ;
10621073 } else {
0 commit comments