Skip to content

Commit

Permalink
PCHR-4396: Fix for the new response format of HRJobContract.getCurren…
Browse files Browse the repository at this point in the history
…tContract

That API now returns an array instead of an object
  • Loading branch information
davialexandre committed Nov 13, 2018
1 parent 8f955f7 commit a3fdbab
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions civihr_employee_portal/src/View/MyDetailsView.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,12 @@ private function getCurrentRevision($contactID) {
'contact_id' => $contactID,
]);

// God knows why but this result is a stdClass
if (!isset($contract['values']->contract_id)) {
if (empty($contract['values']['contract_id'])) {
return NULL;
}

$contractID = $contract['values']->contract_id;

return civicrm_api3('HRJobContractRevision', 'getcurrentrevision', [
'jobcontract_id' => $contractID,
'jobcontract_id' => $contract['values']['contract_id'],
])['values'];
}

Expand Down

0 comments on commit a3fdbab

Please sign in to comment.