Commit 373cfed6 authored by xjm's avatar xjm Committed by tim.plunkett

Issue #1808810 follow-up by xjm: Remove unused parameter.

parent c9fd5715
......@@ -8,21 +8,20 @@
/**
* Fetch Views' data from the cache.
*
* @param string|null $table
* If null return views data for all tables, else
* @param bool $move
* Under certain circumstances it makes sense to not get the moved table, but the old one.
* One example is views_get_handler.
* $param string|null $table
* (optional) The name of the table for which to fetch Views' data. If
* NULL, data for all tables will be retrieved
* @param bool $reset
* If $reset is TRUE, rebuild the internal cache.
* (optional) Whether to rebuild the cache. Defaults to FALSE.
*
* @return array
* An array of views data. If $table is NULL if will contains one info array
* for each table, else just one info array.
* An associative array of views data for the given table. If $table is
* NULL, the array will be keyed by table name, with each key corresponding
* to the data array for that table.
*
* @see hook_views_data
* @see hook_views_data()
*/
function _views_fetch_data($table = NULL, $move = TRUE, $reset = FALSE) {
function _views_fetch_data($table = NULL, $reset = FALSE) {
$cache = &drupal_static(__FUNCTION__ . '_cache');
$recursion_protection = &drupal_static(__FUNCTION__ . '_recursion_protected');
$fully_loaded = &drupal_static(__FUNCTION__ . '_fully_loaded');
......
......@@ -44,7 +44,7 @@ public function testViewsFetchData() {
$this->assertTrue(isset($data[$table_name]), 'Make sure the views_test_data info appears in the total views data.');
$this->assertEqual($data[$table_name], $expected_data[$table_name], 'Make sure the views_test_data has the expected values.');
$data = views_fetch_data(NULL, TRUE, TRUE);
$data = views_fetch_data(NULL, TRUE);
$this->assertTrue(isset($data[$table_name]), 'Make sure the views_fetch_data appears in the total views data with reset = TRUE.');
$this->assertEqual($data[$table_name], $expected_data[$table_name], 'Make sure the views_test_data has the expected values.');
}
......
......@@ -290,6 +290,9 @@
/**
* Describe data tables (or the equivalent) to Views.
*
* The data described with this hook is fetched and retrieved by
* views_fetch_data().
*
* @return array
* An associative array describing the data structure. Primary key is the
* name used internally by Views for the table(s) – usually the actual table
......
......@@ -1284,7 +1284,7 @@ function views_get_handler($table, $field, $type, $override = NULL) {
// Get the plugin manager for this type.
$manager = drupal_container()->get("plugin.manager.views.$type");
$data = views_fetch_data($table, FALSE);
$data = views_fetch_data($table);
if (isset($data[$field][$type])) {
$definition = $data[$field][$type];
foreach (array('group', 'title', 'title short', 'help', 'real field', 'real table') as $key) {
......@@ -1324,10 +1324,23 @@ function views_get_handler($table, $field, $type, $override = NULL) {
/**
* Fetch Views' data from the cache
*
* $param string|null $table
* (optional) The name of the table for which to fetch Views' data. If
* NULL, data for all tables will be retrieved
* @param bool $reset
* (optional) Whether to rebuild the cache. Defaults to FALSE.
*
* @return array
* An associative array of views data for the given table. If $table is
* NULL, the array will be keyed by table name, with each key corresponding
* to the data array for that table.
*
* @see hook_views_data()
*/
function views_fetch_data($table = NULL, $move = TRUE, $reset = FALSE) {
function views_fetch_data($table = NULL, $reset = FALSE) {
views_include('cache');
return _views_fetch_data($table, $move, $reset);
return _views_fetch_data($table, $reset);
}
/**
......
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