You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While playing around with this, I noticed that some of my custom datasources didn't work correctly anymore. These datasources need some param pool values inside the execute function.
So I noticed that there is a conceptual flaw with output parameters in these lines. Basically the datasource gets executed with an empty parameter pool, which is pretty dangerous.
Since my "playground extension" has moved away from the cacheable datasource extension, I am not sending a pull request. But I am posting the solution here, so somebody can integrate it.
Current code:
// Backup the param pool, and see what's been added$tmp = array();
// Fetch the contents$xml = $this->__executeDatasource($ds, $tmp);
$output_params = null;
// Push into the params arrayforeach ($tmpas$name => $value) {
$param_pool[$name] = $value;
}
if (count($tmp) > 0) $output_params = sprintf("%s\n", serialize($tmp));
My code:
// Backup the param pool$old_param_pool = $param_pool;
// Fetch the contents$xml = $this->__executeDatasource($datasource, $param_pool);
// See what has been added to the param pool$new_params = array_diff_key($param_pool, $old_param_pool);
// Create output params string (null or one line)$output_params = null;
if (!empty($new_params)) {
$output_params = sprintf("%s\n", serialize($new_params));
}
The text was updated successfully, but these errors were encountered:
While playing around with this, I noticed that some of my custom datasources didn't work correctly anymore. These datasources need some param pool values inside the execute function.
So I noticed that there is a conceptual flaw with output parameters in these lines. Basically the datasource gets executed with an empty parameter pool, which is pretty dangerous.
Since my "playground extension" has moved away from the cacheable datasource extension, I am not sending a pull request. But I am posting the solution here, so somebody can integrate it.
Current code:
My code:
The text was updated successfully, but these errors were encountered: