Merge pull request #2066 from dpalou/MOBILE-3118

MOBILE-3118 siteplugins: Stringify objects copied from otherdata
main
Juan Leyva 2019-08-22 12:15:24 +01:00 committed by GitHub
commit 152bbca149
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 2 deletions

View File

@ -445,12 +445,23 @@ export class CoreSitePluginsProvider {
// Include only the properties specified in the array.
for (const i in useOtherData) {
const name = useOtherData[i];
args[name] = otherData[name];
if (typeof otherData[name] == 'object' && otherData[name] !== null) {
// Stringify objects.
args[name] = JSON.stringify(otherData[name]);
} else {
args[name] = otherData[name];
}
}
} else {
// Add all the data to args.
for (const name in otherData) {
args[name] = otherData[name];
if (typeof otherData[name] == 'object' && otherData[name] !== null) {
// Stringify objects.
args[name] = JSON.stringify(otherData[name]);
} else {
args[name] = otherData[name];
}
}
}