Skip to content

Commit

Permalink
Use an empty array when watchar params is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
danloa committed Feb 8, 2021
1 parent c87e419 commit 9914b91
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ProcessMaker/Traits/MakeHttpRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,16 +327,20 @@ private function addQueryStringsParamsToUrl($endpoint, array $config, array $da
$url .= $separator . $config['queryString'];
}

if (!array_key_exists('outboundConfig', $config) || !array_key_exists('params', $endpoint)) {
if (!array_key_exists('outboundConfig', $config)) {
$url = $this->getMustache()->render($url, $data);
return $url;
}

$outboundConfig = $config['outboundConfig'];

$dataSourceParams = array_filter($endpoint['params'], function ($item) {
return $item['required'] === true;
});
$dataSourceParams = [];
if(array_key_exists('params', $endpoint)) {
$dataSourceParams = array_filter($endpoint['params'], function ($item) {
return $item['required'] === true;
});
}

$configParams = array_filter($outboundConfig, function ($item) {
return $item['type'] === 'PARAM';
});
Expand Down

0 comments on commit 9914b91

Please sign in to comment.