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.
Profile entities should be rendered together with contextual links for consistency with the general editor flow for entities.
This is fixed by defining the links in profile.links.contextual.yml, adding the links via ProfileViewBuilder::alterBuild() and rendering them via $title_suffix.
Comment | File | Size | Author |
---|---|---|---|
#15 | Screen Shot 2019-03-07 at 2.47.43 PM.png | 44.05 KB | mglaman |
#14 | 2922979-14.patch | 991 bytes | mglaman |
#11 | profile-support_contextual_links-2922979-11.patch | 569 bytes | szeidler |
#3 | profile-contextual_links-2922979-3.patch | 1.59 KB | olofbokedal |
Comments
Comment #2
olofbokedal CreditAttribution: olofbokedal at Odd Hill for European Spallation Source commentedPatch implements the steps mentioned in the issue description.
Comment #3
olofbokedal CreditAttribution: olofbokedal at Odd Hill for European Spallation Source commentedFirst patch didn't include new file. Fixed.
Comment #4
zerolab CreditAttribution: zerolab at Torchbox for The Chartered Society of Physiotherapy commentedComment #6
olofbokedal CreditAttribution: olofbokedal at Odd Hill for European Spallation Source commentederror: profile.links.contextual.yml: No such file or directory
according to the failed test.This file should get created. Anyone knows how to avoid this error? Patch applied cleanly for me but perhaps it needs to be created in a different way.
Comment #7
maaty388 CreditAttribution: maaty388 commentedI believe it has to do something with tests, correct me if I am wrong. Your patch is working fine, gets applied and everything so this is the only thing that I can think of right now.
Comment #8
jwilson3trigger tests again maybe?
Comment #10
bojanz CreditAttribution: bojanz at Centarro commentedYou'll want to retest this on Drupal 8.5.0, which now automatically adds contextual links, making at least the ViewBuilder portion of the patch unnecessary.
Comment #11
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedWith Drupal 8.5.0 and https://www.drupal.org/node/2928555 it seems, that only
{{ title_suffix }}
is required for making the contextual links working for me. Could you review the reduced patch?Comment #12
mglamanPrefix and suffix are defaults. May as well add them both, even we are not rendering the profile label/title separate.
Comment #13
mglamanNevermind, here is what media.html.twig has
Let's just copy them.They prove the existing patch is all we need.Comment #14
mglamanHere is #11 with the links from #3 (otherwise nothing rendered.)
Comment #15
mglamanAttaching a screenshot for good measure.
Comment #17
mglamanCommitted! Thanks, everyone.