Problem/Motivation

In #2638250: The label "Member for" on user profiles is hardcoded markup that is different from other user fields, the "Member for" extra field on the user entity display was deprecated for removal in Drupal 13. There is very little presented to site builders or other users who administer the site via UI about how the extra field can be hidden from the UI and/or replaced by configuring the "Created" field in the display.

Steps to reproduce

Proposed resolution

Two approaches proposed:

I'm wondering if this is one where we should be taking the approach like we did with layout_builder_expose_all_field_blocks - we move this part of the hook into a deprecated module. Then our update hook also enables that module. It reports its deprecated state in status reports/admin UI with a link to the deprecated modules page which tells people how to configure the created field and uninstall the module. I think that solves the admin UI issue.

The first solution does have some complexity:

  • In the update hook, we need to detect whether the `member_for` is being shown on any user displays, and install the new module only if so, otherwise update the displays to remove `member_for` from the `hidden` section
  • In the new module, an uninstall hook to update all user displays to remove the extra field
  • Also in the module, maybe an install hook to update all user displays to add the extra field back?
  • Process to deprecate and remove the module in the future

Perhaps an easier alternative:

Add a requirement to the hook_runtime_requirements in Drupal\user\Hook\UserRequirements::runtime that whether any user displays are showing member_for extra field and provide a warning if so, with instructions.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3615904

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

godotislate created an issue. See original summary.

danielveza’s picture

Title: [pp-1] Display a warning in UI to notify users to remove "Member for" extra field from user display » Display a warning in UI to notify users to remove "Member for" extra field from user display

The issue this was postponed on is in

danielveza’s picture

Status: Active » Needs review

Failing test is a flakey one. Pretty sure it's unrelated.

smustgrave’s picture

Could we scratch out one solution and just a little sentence why the other was chosen pleaseee