@@ -199,23 +199,25 @@ class Language {
199199 emptyIds [ o . _id ] = true ; // Course has no children
200200 }
201201 if ( ! isCourseType && ( ! o . _parentId || ! idIndex [ o . _parentId ] ) ) {
202- orphanedIds [ o . _id ] = true ; // Item has no defined parent id or the parent id doesn't exist
202+ orphanedIds [ o . _id ] = o . _type ; // Item has no defined parent id or the parent id doesn't exist
203203 }
204204 if ( ! isCourseType && o . _parentId && ! idIndex [ o . _parentId ] ) {
205- missingIds [ o . _parentId ] = true ; // Referenced parent item does not exist
205+ missingIds [ o . _parentId ] = o . _type ; // Referenced parent item does not exist
206206 }
207207 } ) ;
208- orphanedIds = Object . keys ( orphanedIds ) ;
208+ const orphanedIdsArray = Object . keys ( orphanedIds ) ;
209+ const missingIdsArray = Object . keys ( missingIds ) ;
209210 emptyIds = Object . keys ( emptyIds ) ;
210211 duplicateIds = Object . keys ( duplicateIds ) ;
211- missingIds = Object . keys ( missingIds ) ;
212212 // Output for each type of error
213- const hasErrored = orphanedIds . length || emptyIds . length || duplicateIds . length || missingIds . length ;
214- if ( orphanedIds . length ) {
215- this . log ( chalk . yellow ( `Orphaned _ids: ${ orphanedIds } ` ) ) ;
213+ const hasErrored = orphanedIdsArray . length || emptyIds . length || duplicateIds . length || missingIdsArray . length ;
214+ if ( orphanedIdsArray . length ) {
215+ const orphanedIdString = orphanedIdsArray . map ( ( id ) => `${ id } (${ orphanedIds [ id ] } )` ) ;
216+ this . log ( chalk . yellow ( `Orphaned _ids: ${ orphanedIdString . join ( ', ' ) } ` ) ) ;
216217 }
217- if ( missingIds . length ) {
218- this . log ( chalk . yellow ( `Missing _ids: ${ missingIds } ` ) ) ;
218+ if ( missingIdsArray . length ) {
219+ const missingIdString = missingIdsArray . map ( ( id ) => `${ id } (${ missingIds [ id ] } )` ) ;
220+ this . log ( chalk . yellow ( `Missing _ids: ${ missingIdString . join ( ', ' ) } ` ) ) ;
219221 }
220222 if ( emptyIds . length ) {
221223 this . log ( chalk . yellow ( `Empty _ids: ${ emptyIds } ` ) ) ;
0 commit comments