Issue #2359703 by dawehner, michaellenahan: Remove public visibility from pager variables on the ViewExecutable.

8.0.x
Alex Pott 2014-11-09 22:29:27 -08:00
parent c58599cb8d
commit 08bf45fc9e
4 changed files with 12 additions and 7 deletions

View File

@ -267,7 +267,7 @@ abstract class ExposedFormPluginBase extends PluginBase {
$all_exposed = array_merge($exposed_sorts, $exposed_filters);
// Set the access to FALSE if there is no exposed input.
if (!array_intersect_key($all_exposed, $this->view->exposed_input)) {
if (!array_intersect_key($all_exposed, $this->view->getExposedInput())) {
$form['actions']['reset']['#access'] = FALSE;
}
}

View File

@ -59,7 +59,7 @@ class InputRequired extends ExposedFormPluginBase {
foreach ($view->filter as $filter) {
if ($filter->isExposed()) {
$identifier = $filter->options['expose']['identifier'];
if (isset($view->exposed_input[$identifier])) {
if (isset($view->getExposedInput()[$identifier])) {
$cache = TRUE;
return $cache;
}

View File

@ -70,7 +70,6 @@ class ViewExecutableTest extends ViewUnitTestBase {
'attachment_before',
'attachment_after',
'exposed_data',
'exposed_input',
'exposed_raw_input',
'old_view',
'parent_views',
@ -186,6 +185,9 @@ class ViewExecutableTest extends ViewUnitTestBase {
foreach ($this->executableProperties as $property) {
$this->assertTrue(isset($view->{$property}));
}
// Per default exposed input should fall back to an empty array.
$this->assertEqual($view->getExposedInput(), []);
}
/**

View File

@ -88,21 +88,21 @@ class ViewExecutable {
*
* @var int
*/
public $current_page = NULL;
protected $current_page = NULL;
/**
* The number of items per page.
*
* @var int
*/
public $items_per_page = NULL;
protected $items_per_page = NULL;
/**
* The pager offset.
*
* @var int
*/
public $offset = NULL;
protected $offset = NULL;
/**
* The total number of rows returned from the query.
@ -139,7 +139,7 @@ class ViewExecutable {
*
* @var array
*/
public $exposed_input = array();
protected $exposed_input = array();
/**
* Exposed widget input directly from the $form_state->getValues().
@ -569,6 +569,9 @@ class ViewExecutable {
// Fill our input either from \Drupal::request()->query or from something
// previously set on the view.
if (empty($this->exposed_input)) {
// Ensure that we can call the method at any point in time.
$this->initDisplay();
$this->exposed_input = \Drupal::request()->query->all();
// unset items that are definitely not our input:
foreach (array('page', 'q') as $key) {