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
Merge requests
!1949
Issue
#3268547
: Document that views_get_current_view() can return NULL
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Issue
#3268547
: Document that views_get_current_view() can return NULL
issue/drupal-3268547:3268547-document-that-viewsgetcurrentview
into
11.x
Overview
0
Commits
4
Pipelines
3
Changes
1
Closed
Pierre Rudloff
requested to merge
issue/drupal-3268547:3268547-document-that-viewsgetcurrentview
into
11.x
3 years ago
Overview
0
Commits
4
Pipelines
3
Changes
1
Expand
0
0
Merge request reports
Compare
11.x
version 4
c2e1ac53
2 months ago
version 3
f269dae2
3 months ago
version 2
50122a93
3 months ago
version 1
50122a93
3 years ago
11.x (base)
and
latest version
latest version
94c37b20
4 commits,
2 months ago
version 4
c2e1ac53
3 commits,
2 months ago
version 3
f269dae2
2 commits,
3 months ago
version 2
50122a93
260 commits,
3 months ago
version 1
50122a93
2 commits,
3 years ago
1 file
+
6
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
core/modules/views/views.module
+
6
−
4
Options
@@ -218,8 +218,9 @@ function views_invalidate_cache() {
* Set the current view that is being built/rendered so that it is
* easy for other modules or items in drupal_eval to identify
*
* @return \Drupal\views\ViewExecutable
* The current view object, or NULL if no view is set.
* @return \Drupal\views\ViewExecutable|null|false
* The current view object, NULL if no view is set yet,
* or FALSE if the view was removed.
*/
function
&
views_set_current_view
(
$view
=
NULL
)
{
static
$cache
=
NULL
;
@@ -236,8 +237,9 @@ function &views_set_current_view($view = NULL) {
* Note that this returns a reference, so be careful! You can unintentionally
* modify the $view object.
*
* @return \Drupal\views\ViewExecutable
* The current view object.
* @return \Drupal\views\ViewExecutable|null|false
* The current view object, NULL if no view is set yet,
* or FALSE if the view was removed.
*/
function
&
views_get_current_view
()
{
return
views_set_current_view
();
Loading