Subject of the issue
stringToBoolean migration helper overwrites existing boolean true values with false during v2.2.0 migration
Your environment
- Framework v2.2.0 migration (
src/core/migrations/v2.js)
Steps to reproduce
- Have a course where one or more boolean config fields (e.g.
config._accessibility._isEnabled) are already stored as a proper boolean true (not the string "true")
- Run the v2.2.0 migration
Expected behaviour
Fields that are already correct booleans should be preserved as-is.
Actual behaviour
The stringToBoolean helper (line 310 of v2.js) only returns true when the input is the string "true". When it receives a non-string value — including an already-correct boolean true — it falls through to return the defaultValue. For _isEnabled, the default is false, so any course with _isEnabled: true has it silently overwritten to false after migration.
Suggested fix
Add a boolean passthrough at the top of stringToBoolean:
function stringToBoolean(str, defaultValue) {
if (_.isBoolean(str)) return str;
if (!_.isString(str)) return defaultValue;
return str.toLowerCase() === 'true';
}
Subject of the issue
stringToBooleanmigration helper overwrites existing booleantruevalues withfalseduring v2.2.0 migrationYour environment
src/core/migrations/v2.js)Steps to reproduce
config._accessibility._isEnabled) are already stored as a proper booleantrue(not the string"true")Expected behaviour
Fields that are already correct booleans should be preserved as-is.
Actual behaviour
The
stringToBooleanhelper (line 310 ofv2.js) only returnstruewhen the input is the string"true". When it receives a non-string value — including an already-correct booleantrue— it falls through to return thedefaultValue. For_isEnabled, the default isfalse, so any course with_isEnabled: truehas it silently overwritten tofalseafter migration.Suggested fix
Add a boolean passthrough at the top of
stringToBoolean: