From f2371d97c1521d5350c47e84be69a467fb10f693 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Wed, 31 May 2017 16:51:22 -0400 Subject: [PATCH 1/4] Update PHP Compatibility for Symphony 4.x --- extension.meta.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extension.meta.xml b/extension.meta.xml index 115ad36..daf69e9 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -31,9 +31,12 @@ - Add cache-expiration attribute in Data Source (#24) - + - Fix regression with ignored data sources (#22) + + - PHP7 Compatibility + - Fix wrong label which is in seconds, not minutes (#22) - Fix potential remote code execution vector From 20b7427df23477fd042cec9efbdd132d553a52ea Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Fri, 25 Aug 2017 09:38:39 -0400 Subject: [PATCH 2/4] Fix release informations --- extension.meta.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extension.meta.xml b/extension.meta.xml index daf69e9..740f4af 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -19,6 +19,9 @@ + + - Update for Symphony 4.x + - Code fix: Use CACHE for consistentcy (#28) @@ -37,6 +40,9 @@ - PHP7 Compatibility + + - Fix regression with ignored data sources (#22) + - Fix wrong label which is in seconds, not minutes (#22) - Fix potential remote code execution vector From 7cb28c9ac289ba0e363957973780df20760aedd3 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Fri, 25 Aug 2017 11:24:57 -0400 Subject: [PATCH 3/4] Relase infos .. Again --- extension.meta.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension.meta.xml b/extension.meta.xml index 740f4af..c3cdd3d 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -19,7 +19,7 @@ - + - Update for Symphony 4.x From 03d93598e872a2446afa1337cf314d1a482c28d3 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Fri, 15 Jun 2018 14:28:46 -0400 Subject: [PATCH 4/4] Fix context conditions and fix JS append --- ...cheabledatasource.blueprintsdatasources.js | 4 +-- extension.driver.php | 28 +++++++++++-------- extension.meta.xml | 1 + 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/assets/cacheabledatasource.blueprintsdatasources.js b/assets/cacheabledatasource.blueprintsdatasources.js index 9cb0617..e9ee466 100644 --- a/assets/cacheabledatasource.blueprintsdatasources.js +++ b/assets/cacheabledatasource.blueprintsdatasources.js @@ -43,9 +43,9 @@ type: 'text', value: datasource.cache }).appendTo(label); - + // Append fieldset - Symphony.Elements.contents.find('div.actions').before(fieldset); + $('#contents div.actions').before(fieldset); }); })(window.jQuery, window.Symphony); diff --git a/extension.driver.php b/extension.driver.php index 70b3095..e781a45 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -131,12 +131,16 @@ private function __fetchSectionsFromContext($context) } // Find any associated sections for the affected section - $associatedSections = Symphony::Database()->fetch(sprintf(' - SELECT DISTINCT `child_section_id`, `parent_section_id` - FROM `tbl_sections_association` - WHERE `parent_section_id` = %1$d OR `child_section_id` = %1$d', - $affectedSection - )); + $associatedSections = Symphony::Database() + ->select(['child_section_id', 'parent_section_id']) + ->distinct() + ->from('tbl_sections_association') + ->where(['or' => [ + ['parent_section_id' => $affectedSection], + ['child_section_id' => $affectedSection], + ]]) + ->execute() + ->rows(); General::flattenArray($associatedSections); $associatedSections = array_values($associatedSections); @@ -265,7 +269,7 @@ public function dataSourcePreExecute($context) // Add an attribute to preg_replace later $xml->setAttribute("cache-age", "fresh"); - + // Add an attribute cache-expiration $xml->setAttribute("cache-expiration", $ds->dsParamCACHE); @@ -293,7 +297,7 @@ private function __buildCacheFilename($datasource, &$filename, &$file_age) { $filename = null; - + // Checks if cacheabledatasource directory exists. If not, try to restore. if (!file_exists(CACHE . '/cacheabledatasource')) { @@ -326,7 +330,7 @@ private function __buildCacheFilename($datasource, &$filename, &$file_age) if (!file_exists($filename)) { return false; } - + // Check if cache is infinite if ($datasource->dsParamCACHE === -1) { return true; @@ -455,7 +459,7 @@ public function initaliseAdminPageHead($context) } $url_context = $page->getContext(); - if (!in_array($url_context[0], array('new', 'edit'))) { + if (!in_array($url_context['action'], array('new', 'edit'))) { return; } @@ -463,8 +467,8 @@ public function initaliseAdminPageHead($context) // if editing an existing data source, instantiate the DS object // to retrieve the dsParamCACHE property if it exists - if ($url_context[0] == 'edit') { - $ds = $url_context[1]; + if ($url_context['action'] == 'edit') { + $ds = $url_context['handle']; $dsm = new DatasourceManager(Symphony::Engine()); $datasource = $dsm->create($ds, null, false); $cache = $datasource->dsParamCACHE; diff --git a/extension.meta.xml b/extension.meta.xml index c3cdd3d..f8b53ee 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -21,6 +21,7 @@ - Update for Symphony 4.x + - Code refactoring for Database and EQFA - Code fix: Use CACHE for consistentcy (#28)