Fix content upgrade bug
parent
b1db442554
commit
0c7df179a7
|
@ -1806,7 +1806,7 @@ class H5PCore {
|
||||||
|
|
||||||
public static $coreApi = array(
|
public static $coreApi = array(
|
||||||
'majorVersion' => 1,
|
'majorVersion' => 1,
|
||||||
'minorVersion' => 16
|
'minorVersion' => 19
|
||||||
);
|
);
|
||||||
public static $styles = array(
|
public static $styles = array(
|
||||||
'styles/h5p.css',
|
'styles/h5p.css',
|
||||||
|
|
|
@ -26,7 +26,7 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
||||||
|
|
||||||
// Make extras possible to work with
|
// Make extras possible to work with
|
||||||
for (var element in extras) {
|
for (var element in extras) {
|
||||||
if (extras.hasOwnProperty(element)) {
|
if (extras[element] !== undefined) {
|
||||||
try {
|
try {
|
||||||
extras[element] = JSON.parse(extras[element]);
|
extras[element] = JSON.parse(extras[element]);
|
||||||
if (!(extras[element] instanceof Object)) {
|
if (!(extras[element] instanceof Object)) {
|
||||||
|
|
|
@ -248,10 +248,9 @@
|
||||||
self.current++;
|
self.current++;
|
||||||
self.working++;
|
self.working++;
|
||||||
|
|
||||||
// Rewrap metadata
|
var extras = {
|
||||||
if (self.extras.metadata) {
|
metadata: (self.extras.metadata && self.extras.metadata[id]) ? self.extras.metadata[id] : undefined
|
||||||
self.extras.metadata = self.extras.metadata[id];
|
};
|
||||||
}
|
|
||||||
|
|
||||||
if (worker) {
|
if (worker) {
|
||||||
worker.postMessage({
|
worker.postMessage({
|
||||||
|
@ -261,11 +260,11 @@
|
||||||
oldVersion: info.library.version,
|
oldVersion: info.library.version,
|
||||||
newVersion: self.version.toString(),
|
newVersion: self.version.toString(),
|
||||||
params: self.parameters[id],
|
params: self.parameters[id],
|
||||||
extras: self.extras
|
extras: extras
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
new H5P.ContentUpgradeProcess(info.library.name, new Version(info.library.version), self.version, self.parameters[id], self.extras, id, function loadLibrary(name, version, next) {
|
new H5P.ContentUpgradeProcess(info.library.name, new Version(info.library.version), self.version, self.parameters[id], extras, id, function loadLibrary(name, version, next) {
|
||||||
self.loadLibrary(name, version, function (err, library) {
|
self.loadLibrary(name, version, function (err, library) {
|
||||||
if (library.upgradesScript) {
|
if (library.upgradesScript) {
|
||||||
self.loadScript(library.upgradesScript, function (err) {
|
self.loadScript(library.upgradesScript, function (err) {
|
||||||
|
|
Loading…
Reference in New Issue