Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The user view modes all seem to get a visible component added to them for masquerade links, this makes the compact view mode (used for displaying user pictures on articles) get the link.
Proposed resolution
Only add the link to the default view_mode.
Remaining tasks
Write Patch
User interface changes
The article meta data will not have masquerade component added to the links by default.
API changes
N/A
Data model changes
N/A
Issue fork masquerade-2923845
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 #2
andypostbtw no idea how to hide it from manage display screen
Comment #4
andypostTest & patch
Comment #6
joelpittetI think that would do the trick, thanks @andypost
Comment #7
BerdirA comon approach is to set the extra field to not be displayed by default at all ('visible' => FALSE), then it can be enabled for the view modes where it should be (e.g. in hook_install() it could be put in the default view mode).
Comment #8
joelpittetThat approach would be better IMO thanks @Berdir. I'll let @andypost decide.
Comment #9
andyposthook_install approach looks better
Comment #10
andypostHere's a patch with install hook, existing sites does not need update so no update hook
Comment #12
andypostSomehow "masquerade" in build array - probably install hook is not executed in kernel tests
Comment #13
andypost