From 022531af664c1c51c44ea9bbada828a19db8ec94 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Thu, 30 May 2013 00:37:05 +0100 Subject: [PATCH] Issue #2003368 by Dan Reinders, marlatt, NonProfit: Rename Views method pre_execute() to preExecute(). --- .../Drupal/views/Plugin/views/display/DisplayPluginBase.php | 4 ++-- .../views/display_extender/DisplayExtenderPluginBase.php | 2 +- .../Plugin/views/exposed_form/ExposedFormPluginBase.php | 2 +- .../lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php | 2 +- .../views/lib/Drupal/views/Plugin/views/query/Sql.php | 2 +- .../lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php | 2 +- .../Plugin/views/display_extender/DisplayExtenderTest.php | 6 +++--- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index d9c2943f567..519ae144148 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -2531,11 +2531,11 @@ abstract class DisplayPluginBase extends PluginBase { $this->view->initHandlers(); if ($this->usesExposed()) { $exposed_form = $this->getPlugin('exposed_form'); - $exposed_form->pre_execute(); + $exposed_form->preExecute(); } foreach ($this->extender as $extender) { - $extender->pre_execute(); + $extender->preExecute(); } $this->view->setShowAdminLinks($this->getOption('show_admin_links')); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php index 02e030eae35..de7dc8be8a3 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php @@ -41,7 +41,7 @@ abstract class DisplayExtenderPluginBase extends PluginBase { /** * Set up any variables on the view prior to execution. */ - public function pre_execute() { } + public function preExecute() { } /** * Inject anything into the query that the display_extender handler needs. diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php index 36865ec9d74..741cf66e379 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php @@ -178,7 +178,7 @@ abstract class ExposedFormPluginBase extends PluginBase { function post_render(&$output) { } - function pre_execute() { } + public function preExecute() { } public function postExecute() { } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php index 19f71d16453..e87134e6c87 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php @@ -205,7 +205,7 @@ abstract class PagerPluginBase extends PluginBase { /** * Perform any needed actions just prior to the query executing. */ - function pre_execute(&$query) { } + public function preExecute(&$query) { } /** * Perform any needed actions just after the query executing. diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php index 7cf2c0c0c2a..f01537d3f33 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php @@ -1484,7 +1484,7 @@ class Sql extends QueryPluginBase { } // Let the pager modify the query to add limits. - $view->pager->pre_execute($query); + $view->pager->preExecute($query); if (!empty($this->limit) || !empty($this->offset)) { // We can't have an offset without a limit, so provide a very large limit instead. diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php index 3ab1a9bd049..5d9e69cfab7 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php @@ -53,7 +53,7 @@ class DisplayExtenderTest extends PluginTestBase { $this->assertTrue($display_extender instanceof \Drupal\views_test_data\Plugin\views\display_extender\DisplayExtenderTest, 'Make sure the right class got initialized.'); $view->preExecute(); - $this->assertTrue($display_extender->testState['pre_execute'], 'Make sure the display extender was able to react on preExecute.'); + $this->assertTrue($display_extender->testState['preExecute'], 'Make sure the display extender was able to react on preExecute.'); $view->execute(); $this->assertTrue($display_extender->testState['query'], 'Make sure the display extender was able to react on query.'); } diff --git a/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php b/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php index 82a212d0d58..248526b0665 100644 --- a/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php +++ b/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php @@ -102,10 +102,10 @@ class DisplayExtenderTest extends DisplayExtenderPluginBase { } /** - * Overrides Drupal\views\Plugin\views\display\DisplayExtenderPluginBase::pre_execute(). + * Overrides Drupal\views\Plugin\views\display\DisplayExtenderPluginBase::preExecute(). */ - public function pre_execute() { - $this->testState['pre_execute'] = TRUE; + public function preExecute() { + $this->testState['preExecute'] = TRUE; } }