Skip to content

Commit 7a93112

Browse files
authored
Display username in user menu (#15973)
1 parent 37a01c0 commit 7a93112

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

_build/data/transport.core.menus.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@
347347
$children[0]= $xpdo->newObject(modMenu::class);
348348
$children[0]->fromArray([
349349
'menuindex' => 0,
350-
'text' => 'profile',
350+
'text' => '{$username}',
351351
'description' => 'profile_desc',
352352
'parent' => 'user',
353353
'permissions' => 'change_profile',

setup/includes/upgrades/common/3.0.0-update-menu-entries.php

+6
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@
3030
}
3131
}
3232

33+
/** @var modMenu $profileItem */
34+
$profileItem = $modx->getObject(modMenu::class, ['text' => 'profile']);
35+
if ($profileItem) {
36+
$profileItem->set('text', '{$username}');
37+
$profileItem->save();
38+
}

0 commit comments

Comments
 (0)