This dates back from when outputting something on a user profile required a implementing a dedicating hook.

This appears to still be relevant to user entities on D8, but there's no output for this currently.

In the new way of working

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

joachim’s picture

A quick search in the code for this shows that nothing actually *uses* this option!

There's showOnProfile(), but only the configuration form calls it.

So it's currently a completely dead option!!! O_o

In D7, this was used in hook_user_view():

/**
 * Implements hook_user_view().
 */
function flag_user_view($account, $view_mode) {
  $flags = flag_get_flags('user');
  $flag_items = array();
  foreach ($flags as $flag) {
    if (!$flag->access($account->uid)) {
      // User has no permission to use this flag.
      continue;
    }
    if (!$flag->show_on_profile) {
      // Flag not set to appear on profile.
      continue;
    }

In D7, hook_user_view() was its own hook. On D8, it still exists, but just as a derivation of hook_ENTITYTYPE_view().

However, it does appear to still have special handling: see this CR: https://www.drupal.org/node/1893032

So the next step is to investigate what the special handling looks like, and how it compares to what we had on D7, and determine whether this is a regression.

joachim’s picture

Title: remove / update show_on_profile option » [regression] implement output of show_on_profile option
Category: Task » Bug report
Issue summary: View changes
FileSize
20.57 KB

Output on D7:

On D8 we no longer have the 'History' heading, so I assume that means the headings have gone completely.

joachim’s picture

Hmm though on D8 these items are just pseudofields, just formatted differently -- see user_entity_extra_field_info().

martin107’s picture

Issue summary: View changes
Status: Active » Needs review
Related issues: +#2716613: Action access control should be on a per FlagType basis.

I am coming to this issue, triaging the beta blockers.

We now have access control on a per flag type basis

While working on that we touched on show_on_profile

Here is a the relevant comment
https://www.drupal.org/node/2716613#comment-11830878

To clarify further, it's not about 'may this user show this user flag on their profile?', which WOULD be about permissions, but 'does this user flag show on the profiles of all users?'.

So definitely something we should look at more closely, and think about either cleaning up or removing, but not as part of this issue.

I would like to do the cleanup/removal aspect of that issue here.

I am not going to comment further, I am still looking over our 10 beta blockers and getting things in order.

joachim’s picture

Status: Needs review » Active

Yup, this issue is to discuss implementation or removal.

joachim’s picture

My user profile on D8, showing a normal pseudofield flag:

The difference is that the user profile field has a label (which on D7 appears to be the admin label of the flag? needs checking!)

On D7 we have the Actions section heading, but my brief investigation seemed to show that the headings don't exist any more -- certainly there's no History heading on my profile.