Fix content upgrade bug

HFP-2095-Fix-table-styling
Paal Joergensen 2018-08-24 12:55:42 +02:00
parent b1db442554
commit 0c7df179a7
3 changed files with 7 additions and 8 deletions

View File

@ -1806,7 +1806,7 @@ class H5PCore {
public static $coreApi = array(
'majorVersion' => 1,
'minorVersion' => 16
'minorVersion' => 19
);
public static $styles = array(
'styles/h5p.css',

View File

@ -26,7 +26,7 @@ H5P.ContentUpgradeProcess = (function (Version) {
// Make extras possible to work with
for (var element in extras) {
if (extras.hasOwnProperty(element)) {
if (extras[element] !== undefined) {
try {
extras[element] = JSON.parse(extras[element]);
if (!(extras[element] instanceof Object)) {

View File

@ -248,10 +248,9 @@
self.current++;
self.working++;
// Rewrap metadata
if (self.extras.metadata) {
self.extras.metadata = self.extras.metadata[id];
}
var extras = {
metadata: (self.extras.metadata && self.extras.metadata[id]) ? self.extras.metadata[id] : undefined
};
if (worker) {
worker.postMessage({
@ -261,11 +260,11 @@
oldVersion: info.library.version,
newVersion: self.version.toString(),
params: self.parameters[id],
extras: self.extras
extras: extras
});
}
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) {
if (library.upgradesScript) {
self.loadScript(library.upgradesScript, function (err) {