Skip to content

[bug]: Profile settings cannot be saved with an empty last name ("Name is required") #10122

Closed

Description

@ars3nicum

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

In Profile settings → General the "Last name" field is shown as optional (no asterisk), but a profile with an empty last name cannot be saved: the field shows "Name is required" and nothing is saved.

The cause is the validation added in #8528: the last_name field uses the same rule as the required first name.

apps/web/components/settings/profile/content/pages/general/form.tsx (preview):

<Controller
  control={control}
  name="last_name"
  rules={{
    validate: validatePersonName,

validatePersonName (packages/utils/src/validation.ts) returns "Name is required" for an empty or whitespace-only value. The API accepts an empty last_name (PATCH /api/users/me/), so only the form blocks it.

Expected: an empty last name can be saved; a non-empty one is validated as before (length, special characters).

A minimal fix that works for us in a self-hosted build: validate the last name only when it is not empty, e.g. validate: (value) => !value?.trim() || validatePersonName(value). Happy to open a PR against preview.

Related: #7281 (onboarding requires the last name, settings treats it as optional), #2511.

Steps to reproduce

  1. Open Profile settings → General.
  2. Clear the Last name field.
  3. Click Save changes.
  4. "Name is required" appears under Last name; the profile is not saved.

Environment

Production

Browser

Other (any browser: it is client-side form validation)

Edition

Community

Version

v1.4.2 (self-hosted); the same code is on preview (checked 2026-10-26).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions