Username not shown in title on user stream

Created on 16 May 2024, 8 months ago

Problem/Motivation

The username is not shown in the page title for user profile streams.

Steps to reproduce

Go to a user profile stream (example /user/2/stream) and there is no username in page title.
The username is show in the title for /user/2/edit .

Is there a way for the username associated with the user profile being looked at, to be in the title of the user stream page?

Feature request
Status

Active

Version

12.3

Component

Front-End

Created by

🇦🇴Angola chipchenko

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @chipchenko
  • Status changed to Closed: won't fix 8 months ago
  • 🇷🇺Russia cuman

    did you manage to solve this?

  • 🇷🇺Russia cuman

    Solution

    Change on /mysite/public_html/profiles/contrib/social/modules/social_features/social_user/social_user.routing.yml this:

    social_user.user_home:
      path: '/user/{user}/home'
      defaults:
        _entity_view: 'user.stream'
      requirements:
        _user_is_logged_in: 'TRUE'
        _custom_access: '\Drupal\social_user\Controller\SocialUserController::accessUsersPages'
    
    social_user.stream:
      path: '/user/{user}/stream'
      defaults:
        _entity_view: 'user.stream'
      requirements:
        _user_is_logged_in: 'TRUE'
        _custom_access: '\Drupal\social_user\Controller\SocialUserController::accessUsersPages'

    On:

    social_user.user_home:
      path: '/user/{user}/home'
      defaults:
        _entity_view: 'user.stream'
      requirements:
        _custom_access: '\Drupal\social_user\Controller\SocialUserController::accessUsersPages'
    
    social_user.stream:
      path: '/user/{user}/stream'
      defaults:
        _entity_view: 'user.stream'
        _title_callback: 'Drupal\user\Controller\UserController::userTitle'
      requirements:
        _custom_access: '\Drupal\social_user\Controller\SocialUserController::accessUsersPages'

    This solution will allow the username to be displayed in the title and will give control over whether the stream is accessible to anonymous users.

    But it will be erased during the update. I suggest that the developers consider this solution for inclusion in the next releases.

Production build 0.71.5 2024