diff --git a/core/modules/aggregator/aggregator.views.inc b/core/modules/aggregator/aggregator.views.inc index 15c22ac..8be6491 100644 --- a/core/modules/aggregator/aggregator.views.inc +++ b/core/modules/aggregator/aggregator.views.inc @@ -2,7 +2,7 @@ /** * @file - * Provides views data and handlers for aggregator.module. + * Provides views data for aggregator.module. * * @ingroup views_module_handlers */ diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/CategoryCid.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/CategoryCid.php index d0fb65c..6bc33ba 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/CategoryCid.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/CategoryCid.php @@ -28,10 +28,7 @@ class CategoryCid extends Numeric { function title_query() { $titles = array(); - $query = db_select('aggregator_category', 'c'); - $query->addField('c', 'title'); - $query->condition('c.cid', $this->value); - $result = $query->execute(); + $result = db_query("SELECT title FROM {aggregator_category} where cid IN (:cid)", array(':cid' => $this->value))->fetchAssoc(); foreach ($result as $term) { $titles[] = check_plain($term->title); } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Fid.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Fid.php index d1018a7..36e6b5e 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Fid.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Fid.php @@ -28,13 +28,9 @@ class Fid extends Numeric { function title_query() { $titles = array(); - $result = db_query("SELECT f.title FROM {aggregator_feed} f WHERE f.fid IN (:fids)", array(':fids' => $this->value)); - $query = db_select('aggregator_feed', 'f'); - $query->addField('f', 'title'); - $query->condition('f.fid', $this->value); - $result = $query->execute(); - foreach ($result as $term) { - $titles[] = check_plain($term->title); + $feeds = drupal_container()->get('plugin.manager.entity')->getStorageController('aggregator_feed')->load($this->value); + foreach ($feeds as $feed) { + $titles[] = check_plain($feed->title); } return $titles; } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Iid.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Iid.php index 6b9070b..aa46fdd 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Iid.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Iid.php @@ -27,14 +27,10 @@ class Iid extends Numeric { */ function title_query() { $titles = array(); - $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d')); - $result = db_select('aggregator_item') - ->condition('iid', $this->value, 'IN') - ->fields(array('title')) - ->execute(); - foreach ($result as $term) { - $titles[] = check_plain($term->title); + $items = drupal_container()->get('plugin.manager.entity')->getStorageController('aggregator_item')->load($this->value); + foreach ($items as $feed) { + $titles[] = check_plain($feed->title); } return $titles; } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/field/Xss.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/field/Xss.php index 242c523..762c1fd 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/field/Xss.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/field/Xss.php @@ -7,7 +7,7 @@ namespace Drupal\aggregator\Plugin\views\field; -use Drupal\views\Plugin\views\field\FieldPluginBase; +use Drupal\views\Plugin\views\field\Xss as XssBase; use Drupal\Core\Annotation\Plugin; /** @@ -20,14 +20,18 @@ * module = "aggregator" * ) */ -class Xss extends FieldPluginBase { +class Xss extends XssBase { /** - * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::render(). + * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::sanitizeValue(). */ - function render($values) { - $value = $this->get_value($values); - return aggregator_filter_xss($value); + protected function sanitizeValue($value, $type = NULL) { + if ($type == 'xss') { + return aggregator_filter_xss($value); + } + else { + return parent::sanitizeValue($value, $type); + } } } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/filter/CategoryCid.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/filter/CategoryCid.php index f49b0e2..5605a0e 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/filter/CategoryCid.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/filter/CategoryCid.php @@ -31,8 +31,6 @@ function get_value_options() { } $this->value_options = array(); - // Uses db_query() rather than db_select() because the query is static and - // does not include any variables. $result = db_query('SELECT * FROM {aggregator_category} ORDER BY title'); foreach ($result as $category) { $this->value_options[$category->cid] = $category->title;