Skip to content

Commit

Permalink
Merge pull request #899 from compucorp/COMPCRM-70-fix-case-webform
Browse files Browse the repository at this point in the history
COMPCRM-70: Fix CiviCase Webform API Related Issue
  • Loading branch information
olayiwola-compucorp authored Apr 11, 2023
2 parents 27c534f + 09a8173 commit 27ed68e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions api/v3/Case/Getwebforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function civicrm_api3_case_getwebforms(array $params) {
foreach ($daos as $dao) {
$data = unserialize($dao->data);

if ($data['case']['number_of_case'] >= 0) {
if ($data['case']['number_of_case'] >= 1) {
$webforms[] = [
'nid' => $dao->nid,
'title' => $dao->title,
Expand Down Expand Up @@ -90,9 +90,11 @@ function _get_case_type_ids_from_webform(array $webform) {
$caseTypeIds = [];

foreach ($webform['case'] as $cases) {
foreach ($cases['case'] as $case) {
if (!empty($case['case_type_id'])) {
array_push($caseTypeIds, $case['case_type_id']);
if (is_array($cases)) {
foreach ($cases['case'] as $case) {
if (!empty($case['case_type_id'])) {
array_push($caseTypeIds, $case['case_type_id']);
}
}
}
}
Expand Down

0 comments on commit 27ed68e

Please sign in to comment.