INF-431: fallback when full name is empty - #4368
Open
bartlomiejmarszal wants to merge 1 commit into
Open
Conversation
bartlomiejmarszal
requested review from
Karol-Stelmaczonek,
KirylHatalski,
pnal and
tikhanovichA
February 2, 2026 15:51
Contributor
📝 WalkthroughWalkthroughModified header navigation template to display a fallback "User" label when the custom user name field is empty in LTI 1.3 contexts. Replaced conditional elseif branch with else clause and introduced displayName variable for consistent fallback behavior. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
Version
There are 0 BREAKING CHANGE, 0 feature, 1 fix |
Front-end summary Node 18
|
Contributor
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@views/templates/blocks/header-main-navi.tpl`:
- Around line 107-113: Add isolated unit tests under tests/ that render the
header-main-navi.tpl with both an empty $userLabel and a non-empty $userLabel
and assert the output contains the expected label: when $userLabel is empty
assert the rendered HTML includes the fallback string "User" (matching the
__('User') translation) and when $userLabel is non-empty assert it includes that
exact label; locate the template logic around $displayName and $userLabel in
header-main-navi.tpl and use the project’s template-rendering helper to render
the template in tests, keeping tests independent (no external services) and
naming them clearly for the empty-label and non-empty-label scenarios.
- Around line 107-113: The fallback for the user label is only computed inside
the else branch, so when $settingsMenu is present the earlier render (the one at
Line 78) outputs an empty label; move the computation of $displayName =
!empty($userLabel) ? $userLabel : __('User') up above the conditional that
checks $settingsMenu so both branches reuse $displayName, remove the duplicated
assignment in the else branch, and ensure the template uses that single
$displayName variable wherever the user label is rendered.
Karol-Stelmaczonek
approved these changes
Feb 2, 2026
Karol-Stelmaczonek
left a comment
Contributor
There was a problem hiding this comment.
- New code is covered by tests (if applicable)
- Tests are running successfully (old and new ones) on my local machine (if applicable)
- New code is respecting code style rules
- New code is respecting best practices
- New code is not subject to concurrency issues (if applicable)
- Feature is working correctly on my local machine (if applicable)
- Acceptance criteria are respected
- Pull request title and description are meaningful
KirylHatalski
approved these changes
Feb 13, 2026
tikhanovichA
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
2026-02-02.16-28-19.mov
Ticket
Related
https://github.com/oat-sa/extension-lti-test-review/pull/161/changes
Summary by CodeRabbit