Skip to content
Snippets Groups Projects

Resolve #2601030 "Views rss view"

Compare and
24 files
+ 746
139
Compare changes
  • Side-by-side
  • Inline

Files

@@ -66,8 +66,7 @@ public function preRender($result) {
*/
public function buildOptionsForm_summary_options() {
$options = parent::buildOptionsForm_summary_options();
$options['title'] = $this->t('Title only');
$options['default'] = $this->t('Use site default RSS settings');
$options[$this::TITLE_VIEW_MODE] = $this->t('Title only');
return $options;
}
@@ -83,9 +82,6 @@ public function render($row) {
}
$view_mode = $this->options['view_mode'];
if ($view_mode == 'default') {
$view_mode = \Drupal::config('system.rss')->get('items.view_mode');
}
// Load the specified comment and its associated node:
/** @var \Drupal\comment\CommentInterface $comment */
@@ -113,7 +109,7 @@ public function render($row) {
// The comment gets built and modules add to or modify
// $comment->rss_elements and $comment->rss_namespaces.
$build = $this->entityTypeManager->getViewBuilder('comment')->view($comment, 'rss');
$build = $this->entityTypeManager->getViewBuilder('comment')->view($comment, $view_mode);
unset($build['#theme']);
if (!empty($comment->rss_namespaces)) {
@@ -121,7 +117,7 @@ public function render($row) {
}
$item = new \stdClass();
if ($view_mode != 'title') {
if ($view_mode != $this::TITLE_VIEW_MODE) {
// We render comment contents.
$item->description = $build;
}
Loading