Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293561

template_preprocess_comment() is inconsistent with uri() and permalink()

$
0
0

Coming from #1970360-99: Entities should define URI templates and standard links

Reference: https://api.drupal.org/api/drupal/core!modules!comment!comment.module/function/template_preprocess_comment/8

Problem description

  1. The following two code snippets are inconsistent with each other:
    <?php
      $permalink_uri
    = $comment->permalink();
     
    $uri['options'] += array('attributes'=> array(
       
    'class'=> 'permalink',
       
    'rel'=> 'bookmark',
      ));
    ?>

    <?php
        $permalink_uri_parent
    = $comment_parent->permalink();
       
    $permalink_uri_parent['options'] += array('attributes'=> array(
         
    'class'=> array('permalink'),
         
    'rel'=> 'bookmark',
        ));
    ?>

    It seems as though the latter is correct and the former is simply a typo. Not sure.
  2. The following two code snippets are also inconsistent with each other:
    <?php
      $variables
    ['title'] = l($comment->subject->value, $uri['path'], $uri['options']);
    ?>

    <?php
        $variables
    ['parent_title'] = l($comment_parent->subject->value, $permalink_uri_parent['path'], $permalink_uri_parent['options']);
    ?>

    In this case it seems as though the former is correct.

Viewing all articles
Browse latest Browse all 293561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>