Skip to content

Commit

Permalink
Ensure values are actually added to the parameter pool. Closes #35
Browse files Browse the repository at this point in the history
  • Loading branch information
brendo committed Aug 13, 2014
1 parent d21c6f7 commit f5c226d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions data-sources/datasource.union.php
Expand Up @@ -860,7 +860,7 @@ public function output(XMLElement &$result, $entries, &$param_pool) {

// Add the Symphony 'system:*' parameters to the param pool
if($this->canDatasourceProcessSystemParameters($datasource)) {
$this->processDatasourceSystemParameters($datasource, $entry);
$this->processDatasourceSystemParameters($datasource, $entry, $param_pool);
}

foreach($data as $field_id => $values) {
Expand All @@ -870,7 +870,7 @@ public function output(XMLElement &$result, $entries, &$param_pool) {
}

// Process output parameters
$this->processDatasourceOutputParameters($datasource, $entry, $field_id, $values);
$this->processDatasourceOutputParameters($datasource, $entry, $field_id, $values, $param_pool);

if (!$datasource->_param_output_only) foreach ($datasource->dsParamINCLUDEDELEMENTS as $handle) {
list($handle, $mode) = preg_split('/\s*:\s*/', $handle, 2);
Expand Down Expand Up @@ -1003,7 +1003,7 @@ public function canDatasourceProcessSystemParameters(Datasource $datasource) {
return false;
}

public function processDatasourceSystemParameters(Datasource $datasource, Entry $entry) {
public function processDatasourceSystemParameters(Datasource $datasource, Entry $entry, &$param_pool) {
if(!isset($datasource->dsParamPARAMOUTPUT)) return;

// Support the legacy parameter `ds-datasource-handle`
Expand Down Expand Up @@ -1033,7 +1033,7 @@ public function processDatasourceSystemParameters(Datasource $datasource, Entry
}
}

public function processDatasourceOutputParameters(Datasource $datasource, Entry $entry, $field_id, array $data) {
public function processDatasourceOutputParameters(Datasource $datasource, Entry $entry, $field_id, array $data, &$param_pool) {
if(!isset($datasource->dsParamPARAMOUTPUT)) return;

// Support the legacy parameter `ds-datasource-handle`
Expand Down Expand Up @@ -1064,6 +1064,8 @@ public function processDatasourceOutputParameters(Datasource $datasource, Entry
if($singleParam) $datasource->_param_pool[$key][] = $param_pool_values;
}
}

$param_pool = array_merge_recursive($param_pool, $datasource->_param_pool);
}
}

Expand Down

0 comments on commit f5c226d

Please sign in to comment.