From 7fc105dc744e3c0b783abf7e69fdd2e9e744af69 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 20 Aug 2019 12:16:57 +0200 Subject: [PATCH] MOBILE-3118 siteplugins: Stringify objects copied from otherdata --- src/core/siteplugins/providers/siteplugins.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/core/siteplugins/providers/siteplugins.ts b/src/core/siteplugins/providers/siteplugins.ts index 7fa661716..fe20b3115 100644 --- a/src/core/siteplugins/providers/siteplugins.ts +++ b/src/core/siteplugins/providers/siteplugins.ts @@ -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]; + } } }