Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
deb93f5f
Unverified
Commit
deb93f5f
authored
Oct 08, 2021
by
larowlan
Browse files
Issue
#3241265
by alexpott: user_user_view() triggers a deprecation in PHP 8.1
parent
9c2be570
Changes
1
Show whitespace changes
Inline
Side-by-side
core/modules/user/user.module
View file @
deb93f5f
...
@@ -299,7 +299,7 @@ function user_is_blocked($name) {
...
@@ -299,7 +299,7 @@ function user_is_blocked($name) {
* Implements hook_ENTITY_TYPE_view() for user entities.
* Implements hook_ENTITY_TYPE_view() for user entities.
*/
*/
function
user_user_view
(
array
&
$build
,
UserInterface
$account
,
EntityViewDisplayInterface
$display
)
{
function
user_user_view
(
array
&
$build
,
UserInterface
$account
,
EntityViewDisplayInterface
$display
)
{
if
(
$display
->
getComponent
(
'member_for'
))
{
if
(
$account
->
isAuthenticated
()
&&
$display
->
getComponent
(
'member_for'
))
{
$build
[
'member_for'
]
=
[
$build
[
'member_for'
]
=
[
'#type'
=>
'item'
,
'#type'
=>
'item'
,
'#markup'
=>
'<h4 class="label">'
.
t
(
'Member for'
)
.
'</h4> '
.
\
Drupal
::
service
(
'date.formatter'
)
->
formatTimeDiffSince
(
$account
->
getCreatedTime
()),
'#markup'
=>
'<h4 class="label">'
.
t
(
'Member for'
)
.
'</h4> '
.
\
Drupal
::
service
(
'date.formatter'
)
->
formatTimeDiffSince
(
$account
->
getCreatedTime
()),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment