Skip to content
Snippets Groups Projects
Commit e1447351 authored by John Voskuilen's avatar John Voskuilen
Browse files

Issue #3269031: PHP 8.1 - Automatic conversion of false to array is deprecated

parent 87a94e31
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,10 @@ class OfficeHoursDatetime extends Datetime {
* - H = 24-hour format of an hour with leading zeros 00 through 23
*/
public static function valueCallback(&$element, $input, FormStateInterface $form_state) {
// Avoid PHP8.1 Deprecated function error:
// "Automatic conversion of false to array is deprecated in [...]."
$input = ($input === FALSE) ? [] : $input;
$input['time'] = OfficeHoursDateHelper::format($element['#default_value'], 'H:i');
$input = parent::valueCallback($element, $input, $form_state);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment