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
- Install Varbase 10.1.x.
- Log in as a user with no extra role and visit
/user. - 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:
After the change below, with the Vartheme BS5 4.1.x component (#3630125):
Proposed resolution
- Add a Varbase Core default recipe,
recipes/default, applied fromvarbase_core_install()withRecipeRunner, as Varbase Admin, Varbase Tour and Varbase Webform do. It ships avarbase_user_profile_detailsECA 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-detailsSDC with: username, full name (only when the site hasfield_full_name, orfield_first_nameandfield_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
| Comment | File | Size | Author |
|---|---|---|---|
| varbase-10.1.x-after.png | 107.77 KB | rajab natshah | |
| varbase-10.1.x-before.png | 70.91 KB | rajab natshah |
Issue fork varbase_core-3630126
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
Comment #3
rajab natshahComment #4
rajab natshahComment #6
rajab natshahComment #8
rajab natshahMerged in MR !94; reviewed and merged by the maintainer.
Comment #9
rajab natshahReviewed by the maintainer. The functional tests passed on a fresh Varbase 10.1.x build from the merged code.
Comment #10
rajab natshah✅ Released varbase_core-10.1.70
Comment #12
rajab natshah