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
Depending on $context['in_preview']
theme key is one of links__comment
or links__comment__comment
(\Drupal\comment\CommentPostRenderCache::buildLinks()
)
Also it looks that altered array of links has different structure
Proposed resolution
Bring consistency in comment links render:
* use link__comment
* discover why comment_links are not altered for preview
* cover with tests
Remaining tasks
tbd
User interface changes
no
API changes
no
Comments
Comment #1
jcandan CreditAttribution: jcandan as a volunteer commentedAs a first-time-contributor-workshop attendee (Novice), but experienced D7 developer, I would appreciate clarity on the problem and proposed resolution. I wasn't able to find any instances where CommentPostRenderCache::buildLinks was being used in the github repo for Drupal core. What have I missed?
Comment #2
larowlanIt's a service based post render callback. If you check comment.services.yml you will find the service ID. Grep for that to find the calls
Comment #3
chaussette CreditAttribution: chaussette as a volunteer commentedHello, i'm new to drupal, but i am experienced symfony developper, i'll try to privide help, i have free time right now
Comment #4
chaussette CreditAttribution: chaussette as a volunteer commentedFor further information and to provide help if I don't manage to solve this issue, the problem is related to themes, you can find the unconsitant line in Drupal core comment module, the path is : \Drupal\Core\Module\Comment\src\CommentPostRenderCache.php line n°235
Comment #5
chaussette CreditAttribution: chaussette as a volunteer commentedInvestigating there is a file called CommentLinkBuilder wich seems suspicious especially the buildCommentedEntityLinks from line 194
Comment #7
cilefen CreditAttribution: cilefen commentedThis is not Novice as evidenced in the comments.
Comment #8
andypostLooks that no more an issue, we not rendering comment links in preview