Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
office_hours
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
office_hours
Commits
e1447351
Commit
e1447351
authored
2 years ago
by
John Voskuilen
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Element/OfficeHoursDatetime.php
+4
-0
4 additions, 0 deletions
src/Element/OfficeHoursDatetime.php
with
4 additions
and
0 deletions
src/Element/OfficeHoursDatetime.php
+
4
−
0
View file @
e1447351
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment