From f5501ec49422eb3b8cb82840264a9b79dbfe7a88 Mon Sep 17 00:00:00 2001 From: jerremeirago Date: Fri, 27 Aug 2021 09:55:17 +0000 Subject: [PATCH 1/6] added SameSite attribute in gdpr banner cookie --- config/plugins/MelisFrontGdprBannerPlugin.config.php | 2 +- public/plugins/js/plugin.melisGdprBanner.init.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/plugins/MelisFrontGdprBannerPlugin.config.php b/config/plugins/MelisFrontGdprBannerPlugin.config.php index 819553b..5490e06 100644 --- a/config/plugins/MelisFrontGdprBannerPlugin.config.php +++ b/config/plugins/MelisFrontGdprBannerPlugin.config.php @@ -17,7 +17,7 @@ '/MelisFront/plugins/css/plugin.gdprBanner.css', ], 'js' => [ - '/MelisFront/plugins/js/plugin.melisGdprBanner.init.js', + '/MelisFront/plugins/js/plugin.melisGdprBanner.init.js?v=3', ], ], ], diff --git a/public/plugins/js/plugin.melisGdprBanner.init.js b/public/plugins/js/plugin.melisGdprBanner.init.js index fcab995..261133c 100644 --- a/public/plugins/js/plugin.melisGdprBanner.init.js +++ b/public/plugins/js/plugin.melisGdprBanner.init.js @@ -30,7 +30,7 @@ window.MelisGdprBanner = (function () { * src: https://zellwk.com/blog/looping-through-js-objects/ */ options = Object.entries({defaultOptions,options}); - var updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value); + var updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) + "; SameSite=Lax"; for (const [key, value] of options) { updatedCookie += "; " + key + "=" + value; } From a2be603635b94b4b69c6e099421d354a8e0a4959 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Sep 2021 16:12:19 +0800 Subject: [PATCH 2/6] Fixed site config condition problem --- src/Service/MelisSiteConfigService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/MelisSiteConfigService.php b/src/Service/MelisSiteConfigService.php index ed7350c..8d5c43d 100644 --- a/src/Service/MelisSiteConfigService.php +++ b/src/Service/MelisSiteConfigService.php @@ -243,7 +243,7 @@ public function getSiteConfig($siteId, $returnAll = false) if (!empty($dbConfigData)) { foreach ($dbConfigData as $dbConf) { - if ($dbConf['sconf_lang_id'] === '-1') { + if ($dbConf['sconf_lang_id'] == '-1') { $siteConfig = ArrayUtils::merge( $siteConfig, [ From f537584a5d6d1cc6def77ec6cd8307822b2ea16c Mon Sep 17 00:00:00 2001 From: jzabate Date: Tue, 5 Oct 2021 17:24:06 +0800 Subject: [PATCH 3/6] part of fixes for drag and drop plugin smashed after saving or publishing [https://mantis2.uat.melistechnology.fr/view.php?id=2152] --- src/Controller/Plugin/MelisFrontTagPlugin.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Controller/Plugin/MelisFrontTagPlugin.php b/src/Controller/Plugin/MelisFrontTagPlugin.php index eaff17d..41d837c 100644 --- a/src/Controller/Plugin/MelisFrontTagPlugin.php +++ b/src/Controller/Plugin/MelisFrontTagPlugin.php @@ -132,9 +132,11 @@ public function back() public function loadDbXmlToPluginConfig() { + $configValues = array(); $xml = simplexml_load_string($this->pluginXmlDbValue); + if ($xml) { $type = isset($this->pluginFrontConfig['type']) ? $this->pluginFrontConfig['type'] : 'html'; @@ -179,11 +181,11 @@ public function savePluginConfigToXml($parameters) } private function getWidths() - { + { // Create an array with the variables that will be available in the view - $this->pluginFrontConfig['widthDesktop'] = isset($this->widthDesktop[0]) ? $this->widthDesktop[0] : 100; - $this->pluginFrontConfig['widthTablet'] = isset($this->widthTablet[0]) ? $this->widthTablet[0] : 100; - $this->pluginFrontConfig['widthMobile'] = isset($this->widthMobile[0]) ? $this->widthMobile[0] : 100; + $this->pluginFrontConfig['widthDesktop'] = (is_array($this->widthDesktop) && isset($this->widthDesktop[0])) ? $this->widthDesktop[0] : 100; + $this->pluginFrontConfig['widthTablet'] = (is_array($this->widthTablet) && isset($this->widthTablet[0])) ? $this->widthTablet[0] : 100; + $this->pluginFrontConfig['widthMobile'] = (is_array($this->widthMobile) && isset($this->widthMobile[0])) ? $this->widthMobile[0] : 100; $this->pluginFrontConfig['pluginContainerId'] = isset($this->pluginContainerId[0]) ? $this->pluginContainerId[0] : null; } From 5d0dca811a3a34ed61586d547001a875c43ee73d Mon Sep 17 00:00:00 2001 From: jzabate Date: Mon, 11 Oct 2021 18:54:08 +0800 Subject: [PATCH 4/6] fix for [https://mantis2.uat.melistechnology.fr/view.php?id=2152] plugin smash on publish/saving --- public/plugins/js/plugin.melistagHTML.init.js | 20 ++++++++++++------- .../plugins/js/plugin.melistagMEDIA.init.js | 7 ++++++- .../js/plugin.melistagTEXTAREA.init.js | 7 ++++++- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/public/plugins/js/plugin.melistagHTML.init.js b/public/plugins/js/plugin.melistagHTML.init.js index dd008bb..a6aa6dd 100644 --- a/public/plugins/js/plugin.melistagHTML.init.js +++ b/public/plugins/js/plugin.melistagHTML.init.js @@ -3,12 +3,10 @@ function melistagHTML_init(idPlugin) { if (typeof idPlugin === "undefined") idPlugin = null; var tinyMceOption = { - templates: - "/melis/MelisCms/PageEdition/getTinyTemplates?idPage=" + - melisActivePageId, + templates: "/melis/MelisCms/PageEdition/getTinyTemplates?idPage=" + melisActivePageId }; - if (idPlugin != null) { + if ( idPlugin != null ) { tinyMceOption.setup = "melistagHTML_savePlugin"; } @@ -28,9 +26,16 @@ function melistagHTML_savePlugin(editor) { $("body").on("blur", "div.html-editable", function() { // get all data-attributes from the clicked var currentdata = $(this).data(); + // var currentdata = $(this).closest(".html-editable").data(); + + var pluginDivId = $(this).closest('.html-editable').attr('id'); + + var content = tinyMCE.get(pluginDivId).getContent({ format: "html" }); // get the content of the active tinyMCE editor. - var content = tinyMCE.activeEditor.getContent({ format: "html" }); + // var content = tinyMCE.activeEditor.getContent({ format: "html" }); + + console.log("plugin.melistagHTML.init.js currentdata: ", currentdata); var data = { melisPluginName: currentdata.plugin, @@ -38,10 +43,11 @@ $("body").on("blur", "div.html-editable", function() { melisPluginId: currentdata.tagId, tagType: currentdata.tagType, tagId: currentdata.tagId, - tagValue: content, + tagValue: content }; + melisPluginEdition.calcFrameHeight(); melisPluginEdition.savePluginUpdate(data, currentdata.siteModule); }); -melistagHTML_init(); +melistagHTML_init(); \ No newline at end of file diff --git a/public/plugins/js/plugin.melistagMEDIA.init.js b/public/plugins/js/plugin.melistagMEDIA.init.js index e35a417..17c0c44 100644 --- a/public/plugins/js/plugin.melistagMEDIA.init.js +++ b/public/plugins/js/plugin.melistagMEDIA.init.js @@ -28,9 +28,14 @@ function melistagMEDIA_savePlugin(editor) { $("body").on("blur", "div.media-editable", function() { // get all data-attributes from the clicked var currentdata = $(this).data(); + // var currentdata = $(this).closest(".html-editable").data(); + + var pluginDivId = $(this).closest('.html-editable').attr('id'); + + var content = tinyMCE.get(pluginDivId).getContent({ format: "html" }); // get the content of the active tinyMCE editor. - var content = tinyMCE.activeEditor.getContent({ format: "html" }); + // var content = tinyMCE.activeEditor.getContent({ format: "html" }); var data = { melisPluginName: currentdata.plugin, diff --git a/public/plugins/js/plugin.melistagTEXTAREA.init.js b/public/plugins/js/plugin.melistagTEXTAREA.init.js index 7d248ee..2137e2a 100644 --- a/public/plugins/js/plugin.melistagTEXTAREA.init.js +++ b/public/plugins/js/plugin.melistagTEXTAREA.init.js @@ -28,9 +28,14 @@ function melistagTEXTAREA_savePlugin(editor) { $("body").on("blur", "div.textarea-editable", function() { // get all data-attributes from the clicked var currentdata = $(this).data(); + // var currentdata = $(this).closest(".html-editable").data(); + + var pluginDivId = $(this).closest('.html-editable').attr('id'); + + var content = tinyMCE.get(pluginDivId).getContent({ format: "html" }); // get the content of the active tinyMCE editor. - var content = tinyMCE.activeEditor.getContent({ format: "html" }); + // var content = tinyMCE.activeEditor.getContent({ format: "html" }); var data = { melisPluginName: currentdata.plugin, From 85a508ea916b111c18a7c98a45cef4a4a22c6ce1 Mon Sep 17 00:00:00 2001 From: jzabate Date: Mon, 11 Oct 2021 19:00:19 +0800 Subject: [PATCH 5/6] fix for [https://mantis2.uat.melistechnology.fr/view.php?id=2152] plugin smash on publish/saving --- public/plugins/js/plugin.melistagHTML.init.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/plugins/js/plugin.melistagHTML.init.js b/public/plugins/js/plugin.melistagHTML.init.js index a6aa6dd..fdadeba 100644 --- a/public/plugins/js/plugin.melistagHTML.init.js +++ b/public/plugins/js/plugin.melistagHTML.init.js @@ -35,8 +35,6 @@ $("body").on("blur", "div.html-editable", function() { // get the content of the active tinyMCE editor. // var content = tinyMCE.activeEditor.getContent({ format: "html" }); - console.log("plugin.melistagHTML.init.js currentdata: ", currentdata); - var data = { melisPluginName: currentdata.plugin, melisPluginTag: currentdata.melisTag, From 744353daef7e4977df59e339004edb0eff6c9850 Mon Sep 17 00:00:00 2001 From: jzabate Date: Wed, 20 Oct 2021 18:39:00 +0800 Subject: [PATCH 6/6] update on fix issue 2152 --- public/plugins/js/plugin.melistagMEDIA.init.js | 2 +- public/plugins/js/plugin.melistagTEXTAREA.init.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/plugins/js/plugin.melistagMEDIA.init.js b/public/plugins/js/plugin.melistagMEDIA.init.js index 17c0c44..c7d4a7a 100644 --- a/public/plugins/js/plugin.melistagMEDIA.init.js +++ b/public/plugins/js/plugin.melistagMEDIA.init.js @@ -30,7 +30,7 @@ $("body").on("blur", "div.media-editable", function() { var currentdata = $(this).data(); // var currentdata = $(this).closest(".html-editable").data(); - var pluginDivId = $(this).closest('.html-editable').attr('id'); + var pluginDivId = $(this).closest('.media-editable').attr('id'); var content = tinyMCE.get(pluginDivId).getContent({ format: "html" }); diff --git a/public/plugins/js/plugin.melistagTEXTAREA.init.js b/public/plugins/js/plugin.melistagTEXTAREA.init.js index 2137e2a..b8609dc 100644 --- a/public/plugins/js/plugin.melistagTEXTAREA.init.js +++ b/public/plugins/js/plugin.melistagTEXTAREA.init.js @@ -30,7 +30,7 @@ $("body").on("blur", "div.textarea-editable", function() { var currentdata = $(this).data(); // var currentdata = $(this).closest(".html-editable").data(); - var pluginDivId = $(this).closest('.html-editable').attr('id'); + var pluginDivId = $(this).closest('.textarea-editable').attr('id'); var content = tinyMCE.get(pluginDivId).getContent({ format: "html" });