Skip to content

Commit 62d3578

Browse files
authored
openaire bugfix
1 parent fde8896 commit 62d3578

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

server/services/search.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,15 @@ function search($service, $dirty_query
8282

8383
// todo: move back into own function once error handling is refactored
8484
if ($service == "openaire") {
85-
$payload = json_encode(array("params" => $post_params));
86-
$res = $apiclient->call_api($service . "/projectdata", $payload);
87-
$result = json_decode($res["result"], true);
88-
if (isset($result["status"]) && $result["status"] === "error") {
89-
return json_encode($result);
90-
}
85+
$payload = json_encode(array("params" => $post_params));
86+
$res = $apiclient->call_api($service . "/projectdata", $payload);
87+
$result = json_decode($res["result"], true);
88+
if (isset($result["status"]) && $result["status"] === "error") {
89+
return json_encode($result);
90+
} else {
91+
$projectdata = $result["projectdata"];
92+
$post_params = array_merge($post_params, $projectdata);
93+
}
9194
}
9295

9396
$params_json = packParamsJSON($param_types, $post_params);

0 commit comments

Comments
 (0)