Problem/Motivation

After logging in, a user lands on their profile page and sees only "Member for". They cannot see their own account details: the email address, time zone, account status, when the account was created or when they last logged in.

Core does not let Views show most of these to the account owner (email, time zone, status and last login are limited to user administrators), so this needs a small rendering layer rather than a view. This is the Varbase 10.1.x counterpart of #3630123 (Varbase 11).

Steps to reproduce

  1. Install Varbase 10.1.x.
  2. Log in as a user with no extra role and visit /user.
  3. Only "Member for" shows.

Environment: Drupal 11.4.9, Varbase 10.1.x-dev, Varbase Core 10.1.x-dev, PHP 8.4, MariaDB 11.8 (DDEV).

Before:
User profile page with only Member for

After the change below, with the Vartheme BS5 4.1.x component (#3630125):
User profile page with the Profile details card

Proposed resolution

  • Add a Varbase Core default recipe, recipes/default, applied from varbase_core_install() with RecipeRunner, as Varbase Admin, Varbase Tour and Varbase Webform do. It ships a varbase_user_profile_details ECA model: an ECA extra field, "Profile details", on the user display, rendered only for the account owner and varying by user; and an ECA block, "User profile details", for the logged-in user, for the Block layout.
  • Both render the active theme's user-profile-details SDC with: username, full name (only when the site has field_full_name, or field_first_name and field_last_name), email, time zone, account status, account created, member for, last login and the user picture. No action buttons: the user page keeps Drupal core's View / Edit tabs. A theme without the component renders nothing.
  • Only Drupal's default user fields are used: no field is added.
  • The extra field is visible by default, so the shipped user display needs no change.
  • New installs only: no update hook.

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support
  • ➖ User Guide Documentation support
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ✅ Reviewed by a human
  • ✅ Code review by maintainers
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ❌ Review with the product owner
  • ✅ Update Release Notes
  • ✅ Release varbase_core-10.1.70

User interface changes

  • A Profile details card on the user's own profile page, and a "User profile details" block.

API changes

  • N/A

Data model changes

  • New config: eca.eca.varbase_user_profile_details.

Release notes snippet

  • Show users their own account details on their profile page, with an ECA model.

AI-Generated: Yes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes

  • rajab natshah committed c21298e8 on 10.1.x
    feat: #3630126 Show users their own account details on their profile...
rajab natshah’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

rajab natshah’s picture

Assigned: Unassigned » rajab natshah
Status: Fixed » Needs review

Merged in MR !94; reviewed and merged by the maintainer.

rajab natshah’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed by the maintainer. The functional tests passed on a fresh Varbase 10.1.x build from the merged code.

rajab natshah’s picture

Assigned: rajab natshah » Unassigned
Issue summary: View changes
Status: Reviewed & tested by the community » Fixed
Issue tags: +varbase_core-10.1.70

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

rajab natshah’s picture

Issue summary: View changes