Ignore overrideSettings parameter fields.

HFP-391
JI-92-path-fix
thomasmars 2016-12-21 11:34:51 +01:00
parent b91be29cec
commit e2634070d4
1 changed files with 23 additions and 4 deletions

View File

@ -1037,6 +1037,28 @@ H5P.findCopyrights = function (info, parameters, contentId) {
if (!parameters.hasOwnProperty(field)) {
continue; // Do not check
}
/*
* TODO: Make parameters clean again
* Some content types adds jQuery or other objects to parameters
* in order to determine override settings for sub-content-types.
* For instance Question Set tells Multiple Choice that it should
* attach Multi Choice's confirmation dialog to a Question Set
* jQuery element, so that the confirmation dialog will not be restricted
* to the space confined by Multi Choice.
* Ideally this should not be added to parameters, we must make a better
* solution. We should likely be adding these to sub-content through
* functions/setters instead of passing them down as params.
*
* This solution is implemented as a hack that will ignore all parameters
* inside a "overrideSettings" field, this should suffice for now since
* all overridden objects are added to this field, however this is not very
* robust solution and will very likely lead to problems in the future.
*/
if (field === 'overrideSettings') {
continue;
}
var value = parameters[field];
if (value instanceof Array) {
@ -1062,9 +1084,6 @@ H5P.findCopyrights = function (info, parameters, contentId) {
info.addMedia(copyrights);
}
}
else {
return;
}
}
};