I would like to disable reply to comment for anonymous user.
I saw on sereval topics that you have to unset
$variables['content']['links']['comment']['#links']['comment-reply']
So I ended up adding a preprocess to the .theme file (bartik.theme since I'm using Bartik. Btw I'm using Drupal 8.5.3)
function bartik_preprocess_comment(&$variables) {
if (\Drupal::currentUser()->isAnonymous()) {
unset($variables['content']['links']['comment']['#links']['comment-reply']);
}
}
Despite that preprocess, I still have the reply link when I'm anonymous. Does anyone has an idea about what's going on ?