@@ -55,6 +55,7 @@ export default class Entries {
5555 protected missingRefs : Record < string , any > = { } ;
5656 public entryMetaData : Record < string , any > [ ] = [ ] ;
5757 public moduleName : keyof typeof auditConfig . moduleConfig = 'entries' ;
58+ public isEntryWithoutTitleField : boolean = false ;
5859
5960 constructor ( { log, fix, config, moduleName, ctSchema, gfSchema } : ModuleConstructorParam & CtConstructorParam ) {
6061 this . log = log ;
@@ -105,7 +106,6 @@ export default class Entries {
105106 if ( this . fix ) {
106107 this . removeMissingKeysOnEntry ( ctSchema . schema as ContentTypeSchemaType [ ] , this . entries [ entryUid ] ) ;
107108 }
108-
109109 this . lookForReference ( [ { locale : code , uid, name : title } ] , ctSchema , this . entries [ entryUid ] ) ;
110110 const message = $t ( auditMsg . SCAN_ENTRY_SUCCESS_MSG , {
111111 title,
@@ -981,10 +981,20 @@ export default class Entries {
981981 const entries = ( await fsUtility . readChunkFiles . next ( ) ) as Record < string , EntryStruct > ;
982982 for ( const entryUid in entries ) {
983983 let { title } = entries [ entryUid ] ;
984+ if ( ! title ) {
985+ this . isEntryWithoutTitleField = true ;
986+ this . log (
987+ `Entry with UID '${ entryUid } ' of Content Type '${ uid } ' in Locale '${ code } ' does not have a 'title' field.` ,
988+ `error` ,
989+ ) ;
990+ }
984991 this . entryMetaData . push ( { uid : entryUid , title } ) ;
985992 }
986993 }
987994 }
988995 }
996+ if ( this . isEntryWithoutTitleField ) {
997+ throw Error ( `Entries found with missing 'title' field! Please make the data corrections and re-run the audit.` ) ;
998+ }
989999 }
9901000}
0 commit comments