Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
workflow
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
workflow
Commits
794d96e3
Commit
794d96e3
authored
8 months ago
by
John Voskuilen
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3507882
: Introduce Hook classes - views.inc
parent
b35f7db4
No related branches found
No related tags found
No related merge requests found
Pipeline
#448793
passed with warnings
8 months ago
Stage: build
Stage: validate
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
workflow.module
+18
-0
18 additions, 0 deletions
workflow.module
workflow.views.inc
+0
-28
0 additions, 28 deletions
workflow.views.inc
with
18 additions
and
28 deletions
workflow.module
+
18
−
0
View file @
794d96e3
...
...
@@ -14,6 +14,7 @@ use Drupal\Core\Routing\RouteMatchInterface;
use
Drupal\Core\Session\AccountInterface
;
use
Drupal\Core\Url
;
use
Drupal\field\Entity\FieldStorageConfig
;
use
Drupal\field\FieldStorageConfigInterface
;
use
Drupal\user\Entity\User
;
use
Drupal\workflow\Entity\Workflow
;
use
Drupal\workflow\Entity\WorkflowConfigTransitionInterface
;
...
...
@@ -22,6 +23,7 @@ use Drupal\workflow\Entity\WorkflowTargetEntity;
use
Drupal\workflow\Entity\WorkflowTransitionInterface
;
use
Drupal\workflow\Hook\WorkflowEntityHooks
;
use
Drupal\workflow\Hook\WorkflowHooks
;
use
Drupal\workflow\Hook\WorkflowViewsHooks
;
use
Drupal\workflow\Entity\WorkflowRole
;
require_once
__DIR__
.
'/workflow.devel.inc'
;
...
...
@@ -86,6 +88,22 @@ function workflow_theme() {
return
\Drupal
::
service
(
WorkflowHooks
::
class
)
->
theme
();
}
/**
* Implements hook_field_views_data().
*/
#[LegacyHook]
function
workflow_field_views_data
(
FieldStorageConfigInterface
$field
)
{
return
\Drupal
::
service
(
WorkflowViewsHooks
::
class
)
->
fieldViewsData
(
$field
);
}
/**
* Implements hook_views_data_alter().
*/
#[LegacyHook]
function
workflow_views_data_alter
(
array
&
$data
)
{
\Drupal
::
service
(
WorkflowViewsHooks
::
class
)
->
viewsDataAlter
(
$data
);
}
/**
* Business related functions, the API.
*/
...
...
...
...
This diff is collapsed.
Click to expand it.
workflow.views.inc
deleted
100644 → 0
+
0
−
28
View file @
b35f7db4
<?php
/**
* @file
* Provide Views data for workflow.module.
*
* @ingroup views_module_handlers
*/
use
Drupal\Core\Hook\Attribute\LegacyHook
;
use
Drupal\field\FieldStorageConfigInterface
;
use
Drupal\workflow\Hook\WorkflowViewsHooks
;
/**
* Implements hook_field_views_data().
*/
#[LegacyHook]
function
workflow_field_views_data
(
FieldStorageConfigInterface
$field
)
{
return
\Drupal
::
service
(
WorkflowViewsHooks
::
class
)
->
fieldViewsData
(
$field
);
}
/**
* Implements hook_views_data_alter().
*/
#[LegacyHook]
function
workflow_views_data_alter
(
array
&
$data
)
{
\Drupal
::
service
(
WorkflowViewsHooks
::
class
)
->
viewsDataAlter
(
$data
);
}
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
sign in
to comment