diff --git a/dotcms-postman/src/main/resources/postman/GraphQLTests.json b/dotcms-postman/src/main/resources/postman/GraphQLTests.json index 5369b0adefb..04b37a9c021 100644 --- a/dotcms-postman/src/main/resources/postman/GraphQLTests.json +++ b/dotcms-postman/src/main/resources/postman/GraphQLTests.json @@ -14878,9 +14878,13 @@ " throw new Error('Could not resolve default language: HTTP ' + response.code);", " }", " const body = response.json();", - " const id = body && body.entity && body.entity.id;", - " if (!id) {", - " throw new Error('Could not resolve default language: entity.id missing in response');", + " let id = body && body.entity && body.entity.id;", + " if (!id || id <= 0) {", + " // _getdefault can return the LANG__404 sentinel (id=-1) in fresh", + " // test environments. Fall back to English (id=1), which is always", + " // present in dotCMS starter data. See issue #35780.", + " console.log('Default language returned invalid id (' + id + '), falling back to English (id=1)');", + " id = 1;", " }", " pm.environment.set('defaultLanguageId', id);", " console.log('defaultLanguageId = ' + id);", diff --git a/dotcms-postman/src/main/resources/postman/Workflow_Resource_Tests.json b/dotcms-postman/src/main/resources/postman/Workflow_Resource_Tests.json index f06e1a4722c..1f10295ecb8 100644 --- a/dotcms-postman/src/main/resources/postman/Workflow_Resource_Tests.json +++ b/dotcms-postman/src/main/resources/postman/Workflow_Resource_Tests.json @@ -19851,9 +19851,13 @@ " throw new Error('Could not resolve default language: HTTP ' + response.code);", " }", " const body = response.json();", - " const id = body && body.entity && body.entity.id;", - " if (!id) {", - " throw new Error('Could not resolve default language: entity.id missing in response');", + " let id = body && body.entity && body.entity.id;", + " if (!id || id <= 0) {", + " // _getdefault can return the LANG__404 sentinel (id=-1) in fresh", + " // test environments. Fall back to English (id=1), which is always", + " // present in dotCMS starter data. See issue #35780.", + " console.log('Default language returned invalid id (' + id + '), falling back to English (id=1)');", + " id = 1;", " }", " pm.environment.set('defaultLanguageId', id);", " console.log('defaultLanguageId = ' + id);",