- Issue created by @nubeli
- 🇨🇦Canada nubeli
Might be related to this PR? https://github.com/colemanw/webform_civicrm/pull/866
- Status changed to Fixed
5 months ago 9:01am 4 August 2024 Automatically closed - issue fixed for 2 weeks with no activity.
1.0 Problem/Motivation
Whenever navigating to the CiviCRM tab on a webform (admin/structure/webform/manage/WEBFORMNAME/civicrm) I see this:
Warning: Undefined array key "caseRoles" in Drupal\webform_civicrm\Fields->wf_crm_get_fields() (line 576 of modules/contrib/webform_civicrm/src/Fields.php).
Drupal\webform_civicrm\Fields->wf_crm_get_fields('fields') (Line: 47)
Drupal\webform_civicrm\Fields->get('fields') (Line: 60)
Drupal\webform_civicrm\Utils->wf_crm_get_fields() (Line: 60)
Drupal\webform_civicrm\AdminForm->initialize(Array, Object, Object) (Line: 53)
Drupal\webform_civicrm\Form\WebformCiviCRMSettingsForm->buildForm(Array, Object)Warning: foreach() argument must be of type array|object, null given in Drupal\webform_civicrm\Fields->wf_crm_get_fields() (line 576 of modules/contrib/webform_civicrm/src/Fields.php).
Drupal\webform_civicrm\Fields->wf_crm_get_fields('fields') (Line: 47)
Drupal\webform_civicrm\Fields->get('fields') (Line: 60)
Drupal\webform_civicrm\Utils->wf_crm_get_fields() (Line: 60)
Drupal\webform_civicrm\AdminForm->initialize(Array, Object, Object) (Line: 53)
Drupal\webform_civicrm\Form\WebformCiviCRMSettingsForm->buildForm(Array, Object)
2.0 Detailed steps to reproduce (embed screenshots)
This happens when a case type is disabled and has no definition. And thus it doesn't have roles defined either.
3.0 Proposed resolution
The best thing to do here maybe is to both check if a case type is enabled and also if the array key exists.
Fixed
6.2
Code
Might be related to this PR? https://github.com/colemanw/webform_civicrm/pull/866
Automatically closed - issue fixed for 2 weeks with no activity.