From e80d6274af11e8739ff7509b60ad4c5df2242511 Mon Sep 17 00:00:00 2001 From: Vytautas Nekrasevicius Date: Thu, 17 Oct 2019 11:36:56 +0300 Subject: [PATCH] try parse before handling messages --- Model/Config.php | 2 +- composer.json | 2 +- view/adminhtml/web/js/admin.js | 2 +- view/frontend/templates/head/head.phtml | 96 ++++++++++++++----------- 4 files changed, 58 insertions(+), 44 deletions(-) diff --git a/Model/Config.php b/Model/Config.php index b198745..1d4ba54 100755 --- a/Model/Config.php +++ b/Model/Config.php @@ -16,7 +16,7 @@ class Config const TRUSTPILOT_GENERAL_CONFIGURATION = 'general'; const TRUSTPILOT_TRUSTBOX_CONFIGURATION = 'trustbox'; const TRUSTPILOT_INTEGRATION_KEY = 'key'; - const TRUSTPILOT_PLUGIN_VERSION = '2.6.495'; + const TRUSTPILOT_PLUGIN_VERSION = '2.6.500'; const TRUSTPILOT_SCRIPT = 'TrustpilotScriptUrl'; const TRUSTPILOT_INTEGRATION_APP = 'IntegrationAppUrl'; const TRUSTPILOT_WIDGET_SCRIPT = 'WidgetScriptUrl'; diff --git a/composer.json b/composer.json index 45da070..63b1fd5 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "trustpilot/module-reviews", "description": "The Trustpilot Review extension makes it simple and easy for merchants to collect reviews from their customers to power their marketing efforts, increase sales conversion, build their online reputation and draw business insights.", "type": "magento2-module", - "version": "2.6.495", + "version": "2.6.500", "license": [ "OSL-3.0" ], diff --git a/view/adminhtml/web/js/admin.js b/view/adminhtml/web/js/admin.js index c09fa76..b53bd6a 100755 --- a/view/adminhtml/web/js/admin.js +++ b/view/adminhtml/web/js/admin.js @@ -78,7 +78,7 @@ function receiveInternalData(e) { const parsedData = {}; if (data && typeof data === 'string' && tryParseJson(data, parsedData)) { if (parsedData.type === 'updatePageUrls' || parsedData.type === 'newTrustBox') { - this.submitSettings(jsonData); + this.submitSettings(parsedData); } } } diff --git a/view/frontend/templates/head/head.phtml b/view/frontend/templates/head/head.phtml index b8b95b7..192779e 100755 --- a/view/frontend/templates/head/head.phtml +++ b/view/frontend/templates/head/head.phtml @@ -1,53 +1,67 @@ \ No newline at end of file