From 94e4bb5e11d30e89c3379a72bdc2896aafba7b05 Mon Sep 17 00:00:00 2001 From: lunaris Date: Sun, 26 Aug 2012 10:10:00 +0200 Subject: [PATCH] Issue #1748114 by lunaris | damiankloip: Replace calls to comment properties with entity interface methods. --- lib/Views/comment/Plugin/views/field/Link.php | 2 +- lib/Views/comment/Plugin/views/field/LinkEdit.php | 2 +- lib/Views/comment/Plugin/views/row/Rss.php | 6 +++--- lib/Views/comment/Plugin/views/row/View.php | 2 +- modules/comment.views.inc | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Views/comment/Plugin/views/field/Link.php b/lib/Views/comment/Plugin/views/field/Link.php index 974ed8c380d..5467f403465 100644 --- a/lib/Views/comment/Plugin/views/field/Link.php +++ b/lib/Views/comment/Plugin/views/field/Link.php @@ -61,7 +61,7 @@ class Link extends Entity { $text = !empty($this->options['text']) ? $this->options['text'] : t('view'); $comment = $this->get_value($values); $nid = $comment->nid; - $cid = $comment->cid; + $cid = $comment->id(); $this->options['alter']['make_link'] = TRUE; $this->options['alter']['html'] = TRUE; diff --git a/lib/Views/comment/Plugin/views/field/LinkEdit.php b/lib/Views/comment/Plugin/views/field/LinkEdit.php index 2d16ef6425b..85c12acacc8 100644 --- a/lib/Views/comment/Plugin/views/field/LinkEdit.php +++ b/lib/Views/comment/Plugin/views/field/LinkEdit.php @@ -55,7 +55,7 @@ class LinkEdit extends Link { $this->options['alter']['query'] = drupal_get_destination(); } - $this->options['alter']['path'] = "comment/" . $comment->cid . "/edit"; + $this->options['alter']['path'] = "comment/" . $comment->id() . "/edit"; return $text; } diff --git a/lib/Views/comment/Plugin/views/row/Rss.php b/lib/Views/comment/Plugin/views/row/Rss.php index 1dcde07d23c..130db0716e9 100644 --- a/lib/Views/comment/Plugin/views/row/Rss.php +++ b/lib/Views/comment/Plugin/views/row/Rss.php @@ -129,7 +129,7 @@ class Rss extends RowPluginBase { ), array( 'key' => 'guid', - 'value' => 'comment ' . $comment->cid . ' at ' . $base_url, + 'value' => 'comment ' . $comment->id() . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'false'), ), ); @@ -156,10 +156,10 @@ class Rss extends RowPluginBase { $item = new stdClass(); $item->description = $item_text; - $item->title = $comment->subject; + $item->title = $comment->label(); $item->link = $comment->link; $item->elements = $comment->rss_elements; - $item->cid = $comment->cid; + $item->cid = $comment->id(); return theme($this->theme_functions(), array( 'view' => $this->view, diff --git a/lib/Views/comment/Plugin/views/row/View.php b/lib/Views/comment/Plugin/views/row/View.php index 642222cd7b9..477ba61d340 100644 --- a/lib/Views/comment/Plugin/views/row/View.php +++ b/lib/Views/comment/Plugin/views/row/View.php @@ -102,7 +102,7 @@ class View extends RowPluginBase { $nids = array(); foreach ($cresult as $comment) { $comment->depth = count(explode('.', $comment->thread)) - 1; - $this->comments[$comment->cid] = $comment; + $this->comments[$comment->id()] = $comment; $nids[] = $comment->nid; } diff --git a/modules/comment.views.inc b/modules/comment.views.inc index 53146f714eb..28c9d5a6f6f 100644 --- a/modules/comment.views.inc +++ b/modules/comment.views.inc @@ -614,7 +614,7 @@ function template_preprocess_views_view_row_comment(&$vars) { // Put the view on the node so we can retrieve it in the preprocess. $node->view = &$view; - $build = comment_view_multiple(array($comment->cid => $comment), $node, $plugin->options['view_mode']); + $build = comment_view_multiple(array($comment->id() => $comment), $node, $plugin->options['view_mode']); // If we're displaying the comments without links, remove them from the // renderable array. There is no way to avoid building them in the first // place (see comment_build_content()).