Skip to content

Commit a8ef820

Browse files
committed
Users: Hid lanuage preference for guest user
Hiding since it's not really used, and may mislead on how to set default app language (which should be done via env options). Updated test to cover. For #5356
1 parent 7e1a8e5 commit a8ef820

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

resources/views/users/edit.blade.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class="setting-list-label">{{ trans('settings.users_avatar') }}</label>
3434
</div>
3535
</div>
3636

37-
@include('users.parts.language-option-row', ['value' => old('language') ?? $user->getLocale()->appLocale()])
37+
@if(!$user->isGuest())
38+
@include('users.parts.language-option-row', ['value' => old('language') ?? $user->getLocale()->appLocale()])
39+
@endif
3840
</div>
3941

4042
<div class="text-right">

tests/User/UserManagementTest.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,13 @@ public function test_delete_removes_user_preferences()
202202
public function test_guest_profile_shows_limited_form()
203203
{
204204
$guest = $this->users->guest();
205+
205206
$resp = $this->asAdmin()->get('/settings/users/' . $guest->id);
206207
$resp->assertSee('Guest');
207-
$this->withHtml($resp)->assertElementNotExists('#password');
208+
$html = $this->withHtml($resp);
209+
210+
$html->assertElementNotExists('#password');
211+
$html->assertElementNotExists('[name="language"]');
208212
}
209213

210214
public function test_guest_profile_cannot_be_deleted()

0 commit comments

Comments
 (0)