diff --git a/src/topics/create.js b/src/topics/create.js index 8e732215bc..ccbda53989 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -35,7 +35,7 @@ module.exports = function (Topics) { lastposttime: 0, postcount: 0, viewcount: 0, - isAnonymous: data.isAnonymous, + isAnonymous: data.isAnonymous || 'false', }; if (Array.isArray(data.tags) && data.tags.length) { diff --git a/test/topics.js b/test/topics.js index fdc0e5893f..bada031de6 100644 --- a/test/topics.js +++ b/test/topics.js @@ -2573,6 +2573,8 @@ describe('Anonymous Topic Creation', () => { title: 'Default Topic Example', content: 'This topic does not specify anonymity', }); + + console.log('Checking isAnonymous by default:', newTopic.topicData.isAnonymous); assert(newTopic); assert.strictEqual(newTopic.topicData.isAnonymous, 'false', 'Expected the topic to default to non-anonymous');