Commit 7dc6bbf0 authored by catch's avatar catch

Issue #2014043 by kgoel, nathangervais: Replace drupal_container() with...

Issue #2014043 by kgoel, nathangervais: Replace drupal_container() with \Drupal in the views module.
parent 3e839344
......@@ -1741,7 +1741,7 @@ public function buildOptionsForm(&$form, &$form_state) {
break;
case 'analyze-theme':
$form['#title'] .= t('Theming information');
if ($theme = drupal_container()->get('request')->request->get('theme')) {
if ($theme = \Drupal::request()->request->get('theme')) {
$this->theme = $theme;
}
elseif (empty($this->theme)) {
......
......@@ -1483,7 +1483,7 @@ public function getRenderTokens($item) {
}
// Get flattened set of tokens for any array depth in $_GET parameters.
$tokens += $this->getTokenValuesRecursive(drupal_container()->get('request')->query->all());
$tokens += $this->getTokenValuesRecursive(\Drupal::request()->query->all());
// Now add replacements for our fields.
foreach ($this->view->display_handler->getHandlers('field') as $field => $handler) {
......
......@@ -211,7 +211,7 @@ public function validateOptionsForm(&$form, &$form_state) {
public function query() {
if ($this->itemsPerPageExposed()) {
$query = drupal_container()->get('request')->query;
$query = \Drupal::request()->query;
$items_per_page = $query->get('items_per_page');
if ($items_per_page > 0) {
$this->options['items_per_page'] = $items_per_page;
......@@ -221,7 +221,7 @@ public function query() {
}
}
if ($this->isOffsetExposed()) {
$query = drupal_container()->get('request')->query;
$query = \Drupal::request()->query;
$offset = $query->get('offset');
if (isset($offset) && $offset >= 0) {
$this->options['offset'] = $offset;
......@@ -265,7 +265,7 @@ public function setCurrentPage($number = NULL) {
// Fill in missing values in the global page array, in case the global page
// array hasn't been initialized before.
$page = drupal_container()->get('request')->query->get('page');
$page = \Drupal::request()->query->get('page');
$page = isset($page) ? explode(',', $page) : array();
for ($i = 0; $i <= $this->options['id'] || $i < count($pager_page_array); $i++) {
......
......@@ -84,10 +84,9 @@ public function testPluginData() {
* This will iterate through all plugins from _views_fetch_plugin_data().
*/
public function testPluginInstances() {
$container = drupal_container();
foreach ($this->definitions as $type => $plugins) {
// Get a plugin manager for this type.
$manager = $container->get("plugin.manager.views.$type");
$manager = $this->container->get("plugin.manager.views.$type");
foreach ($plugins as $id => $definition) {
// Get a reflection class for this plugin.
// We only want to test true plugins, i.e. They extend PluginBase.
......
......@@ -570,7 +570,7 @@ public function getExposedInput() {
// Fill our input either from $_GET or from something previously set on the
// view.
if (empty($this->exposed_input)) {
$this->exposed_input = drupal_container()->get('request')->query->all();
$this->exposed_input = \Drupal::request()->query->all();
// unset items that are definitely not our input:
foreach (array('page', 'q') as $key) {
if (isset($this->exposed_input[$key])) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment