Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
373cfed6
Commit
373cfed6
authored
12 years ago
by
Jess
Committed by
Tim Plunkett
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1808810
follow-up by xjm: Remove unused parameter.
parent
c9fd5715
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
includes/cache.inc
+9
-10
9 additions, 10 deletions
includes/cache.inc
lib/Drupal/views/Tests/ViewsDataTest.php
+1
-1
1 addition, 1 deletion
lib/Drupal/views/Tests/ViewsDataTest.php
views.api.php
+3
-0
3 additions, 0 deletions
views.api.php
views.module
+16
-3
16 additions, 3 deletions
views.module
with
29 additions
and
14 deletions
includes/cache.inc
+
9
−
10
View file @
373cfed6
...
...
@@ -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'
);
...
...
This diff is collapsed.
Click to expand it.
lib/Drupal/views/Tests/ViewsDataTest.php
+
1
−
1
View file @
373cfed6
...
...
@@ -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.'
);
}
...
...
This diff is collapsed.
Click to expand it.
views.api.php
+
3
−
0
View file @
373cfed6
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
views.module
+
16
−
3
View file @
373cfed6
...
...
@@ -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
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment