HFP-1905 Fix updating for scripts with old update functions
"params" (and "extras", e.g. metadata) flow through each update function and are changed if necessary. Since "extras" was added later and old update functions don't return it, we need to ignore undefined values -- or change every single update function in all content types.pull/52/head
parent
3b38e273eb
commit
58597460f6
|
@ -130,7 +130,15 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
||||||
try {
|
try {
|
||||||
unnecessaryWrapper(params, function (err, upgradedParams, upgradedExtras) {
|
unnecessaryWrapper(params, function (err, upgradedParams, upgradedExtras) {
|
||||||
params = upgradedParams;
|
params = upgradedParams;
|
||||||
|
/**
|
||||||
|
* "params" (and "extras", e.g. metadata) flow through each update function and are changed
|
||||||
|
* if necessary. Since "extras" was added later and old update functions don't return
|
||||||
|
* it, we need to ignore undefined values here -- or change every single update function
|
||||||
|
* in all content types.
|
||||||
|
*/
|
||||||
|
if (upgradedExtras) {
|
||||||
extras = upgradedExtras;
|
extras = upgradedExtras;
|
||||||
|
}
|
||||||
nextMinor(err);
|
nextMinor(err);
|
||||||
}, extras);
|
}, extras);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue