PHP8: Delete Case link causes fatal error
Reproduction steps
- Go to the Cases dashboard, or on a contact's Case tab.
- Click the "Delete" link for a case.
Current behaviour
- Error on screen: "Network Error"
- Behind the scenes: Error: Cannot unset offset in a non-array variable in CRM_Core_Form->buildForm() (line 692 of CRM/Core/Form.php)
Expected behaviour
Confirmation dialog should pop up, allowing you to go through with the deletion.
Environment information
PHP 8.16 CiviCRM 5.59 (but the code in question goes back at least 10 years)
Comments
The problem arises because CRM_Case_Form_Case->setDefaultValues()
returns a boolean instead of the expected array.