Skip to content

Commit

Permalink
Merge pull request #562 from compucorp/PCHR-4396-fix-hrjobcontract-wa…
Browse files Browse the repository at this point in the history
…rning

PCHR-4396: Fix "creating default object from empty value" warning on the SSP
  • Loading branch information
davialexandre authored Dec 10, 2018
2 parents 261b14a + a3fdbab commit 9bc8697
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 9bc8697

Please sign in to comment.