From 85c5367ea5174956d1bd5bddaef29556c3792c86 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Tue, 23 May 2017 11:04:59 -0400 Subject: [PATCH 1/5] PHP7 Compatibility release --- extension.meta.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extension.meta.xml b/extension.meta.xml index 22dd341..77745ec 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -14,6 +14,10 @@ + + * Update for Symphony 4.x + * PHP7 Compatibility + * [#43](https://github.com/brendo/uniondatasource/issues/43) Fix formatted textarea being escaped (thanks @Aonrud) * [#42](https://github.com/brendo/uniondatasource/issues/42) Prevent parameters from duplicating in the output (thanks @moretaste) From aa6b597e0f06b5d756767d3b8a98da55296cf55e Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Thu, 24 Aug 2017 16:10:20 -0400 Subject: [PATCH 2/5] SQL and PHP cases PHP true,false,null in lowercase SQL keywords uppercase --- templates/blueprints.datasource.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/blueprints.datasource.tpl b/templates/blueprints.datasource.tpl index 5b84f69..395f73e 100644 --- a/templates/blueprints.datasource.tpl +++ b/templates/blueprints.datasource.tpl @@ -20,7 +20,7 @@ 'system:pagination' ); - public function __construct($env=NULL, $process_params=true){ + public function __construct($env = null, $process_params = true){ parent::__construct($env, $process_params); $this->_dependencies = array(); } From 31018bcd101c45c81981448c5b388cf7db0eb3bd Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Fri, 25 Aug 2017 11:28:33 -0400 Subject: [PATCH 3/5] 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 77745ec..f8552fa 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -14,7 +14,7 @@ - + * Update for Symphony 4.x * PHP7 Compatibility From 798a2be7c9dd0a844b0d1ece80a097a12b2d31c2 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Tue, 19 Jun 2018 11:29:32 -0400 Subject: [PATCH 4/5] Replace deprecated method fetch() by select() --- data-sources/datasource.union.php | 53 ++++++++++++++++++++++++------- extension.meta.xml | 1 + 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/data-sources/datasource.union.php b/data-sources/datasource.union.php index bf75194..35a0b3d 100644 --- a/data-sources/datasource.union.php +++ b/data-sources/datasource.union.php @@ -240,7 +240,11 @@ public static function buildEditor(XMLElement $wrapper, array &$errors = array() $i = 0; foreach($datasources as $handle => $datasource) { $about = $datasource->about(); - $source = SectionManager::fetch($datasources[$handle]->getSource()); + $source = (new SectionManager) + ->select() + ->section($datasources[$handle]->getSource()) + ->execute() + ->next(); if(($source instanceof Section) === false) continue; @@ -278,7 +282,11 @@ public static function buildEditor(XMLElement $wrapper, array &$errors = array() if(!isset($datasources[$handle])) continue; $about = $datasources[$handle]->about(); - $source = SectionManager::fetch($datasources[$handle]->getSource()); + $source = (new SectionManager) + ->select() + ->section($datasources[$handle]->getSource()) + ->execute() + ->next(); if(($source instanceof Section) === false) continue; @@ -384,9 +392,11 @@ public function grab(array &$param_pool = null) { str_replace('-','_', $handle), $this->_env, true ); - $this->datasources[$handle]['section'] = SectionManager::fetch( - $this->datasources[$handle]['datasource']->getSource() - ); + $this->datasources[$handle]['section'] = (new SectionManager) + ->select() + ->section($this->datasources[$handle]['datasource']->getSource()) + ->execute() + ->next(); $result->appendChild( new XMLElement('section', General::sanitize($this->datasources[$handle]['section']->get('name')), array( @@ -506,7 +516,12 @@ public function grab_sql(Datasource $datasource) { include_once(TOOLKIT . '/class.entrymanager.php'); - if(!$section = SectionManager::fetch((int)$datasource->getSource())){ + if(!$section = (new SectionManager) + ->select() + ->section((int)$datasource->getSource()) + ->execute() + ->next() + ){ $about = $datasource->about(); trigger_error(__('The section associated with the data source %s could not be found.', array('' . $about['name'] . '')), E_USER_ERROR); } @@ -556,9 +571,11 @@ public function grab_sql(Datasource $datasource) { } // Handle real field instances else { - $field = FieldManager::fetch( - FieldManager::fetchFieldIDFromElementName($datasource->dsParamSORT, $datasource->getSource()) - ); + $field = (new FieldManager) + ->select() + ->field(FieldManager::fetchFieldIDFromElementName($datasource->dsParamSORT, $datasource->getSource())) + ->execute() + ->next(); $field->buildSortingSQL($joins, $where, $data['sort'], $datasource->dsParamORDER); @@ -841,7 +858,11 @@ public function output(XMLElement &$result, $entries, &$param_pool) { // Setup any datasources variables ONCE. if(!isset($ds['datasource']->_param_pool)) { $ds['datasource']->_param_pool = $param_pool; - $pool = FieldManager::fetch(array_keys($data)); + $pool = (new FieldManager) + ->select() + ->fields(array_keys($data)) + ->execute() + ->rows(); self::$field_pool += $pool; if (!isset($datasource->dsParamASSOCIATEDENTRYCOUNTS) || $datasource->dsParamASSOCIATEDENTRYCOUNTS == 'yes') { @@ -866,7 +887,11 @@ public function output(XMLElement &$result, $entries, &$param_pool) { foreach($data as $field_id => $values) { // Check to see if we have a Field object already, if not create one if(!isset(self::$field_pool[$field_id]) || !self::$field_pool[$field_id] instanceof Field) { - self::$field_pool[$field_id] = FieldManager::fetch($field_id); + self::$field_pool[$field_id] = (new FieldManager) + ->select() + ->field($field_id) + ->execute() + ->next(); } // Process output parameters @@ -913,7 +938,11 @@ public function output(XMLElement &$result, $entries, &$param_pool) { public function processDatasourceFilters(Datasource $datasource, &$where, &$joins, &$group) { if(!is_array($datasource->dsParamFILTERS) || empty($datasource->dsParamFILTERS)) return; - $pool = FieldManager::fetch(array_filter(array_keys($datasource->dsParamFILTERS), 'is_int')); + $pool = (new FieldManager) + ->select() + ->fields(array_filter(array_keys($datasource->dsParamFILTERS), 'is_int')) + ->execute() + ->rows(); self::$field_pool += $pool; foreach($datasource->dsParamFILTERS as $field_id => $filter){ diff --git a/extension.meta.xml b/extension.meta.xml index f8552fa..5a53e3d 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -17,6 +17,7 @@ * Update for Symphony 4.x * PHP7 Compatibility + * Replace deprecated method fetch() by select() * [#43](https://github.com/brendo/uniondatasource/issues/43) Fix formatted textarea being escaped (thanks @Aonrud) From 96da34f7958d7bb857c70b3b3f1fb71b6c545bd8 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Wed, 10 Oct 2018 14:54:01 -0400 Subject: [PATCH 5/5] Fix error - Cannot make function providerOf static --- extension.driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension.driver.php b/extension.driver.php index 4d4739e..7eeeed3 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -16,7 +16,7 @@ public static function registerProviders() { return true; } - public static function providerOf($type = null) { + public function providerOf($type = null) { self::registerProviders(); if(is_null($type)) return self::$provides;