Skip to content

Commit

Permalink
Fix PHP 8.2 deprecated warning
Browse files Browse the repository at this point in the history
When editing an issue with a Custom Field of type Checkbox and the
field's value is null, a deprecated warning is shown with PHP 8.2

DEPRECATED: 'explode(): Passing null to parameter 0000002 ($string) of
type string is deprecated' in ./core/cfdefs/cfdef_standard.php' line 406

Fixes #34439
  • Loading branch information
dregad committed May 8, 2024
1 parent 5442e83 commit 1f35501
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/cfdefs/cfdef_standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ function cfdef_input_list( array $p_field_def, $p_custom_field_value, $p_require
*/
function cfdef_input_checkbox( array $p_field_def, $p_custom_field_value, $p_required = '' ) {
$t_values = explode( '|', custom_field_prepare_possible_values( $p_field_def['possible_values'] ) );
$t_checked_values = explode( '|', $p_custom_field_value );
$t_checked_values = explode( '|', $p_custom_field_value ?? '' );
for( $i = 0; $i < count( $t_values ); $i++ ) {
$t_input_id = 'custom_field_' . $p_field_def['id'] . '_value_' . $i;
$t_input_name = 'custom_field_' . $p_field_def['id'] . '[]';
Expand Down

0 comments on commit 1f35501

Please sign in to comment.