Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gdpr-3350866
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
gdpr-3350866
Commits
e8dce594
Commit
e8dce594
authored
6 years ago
by
Levente Besenyei
Browse files
Options
Downloads
Patches
Plain Diff
CS fixes
parent
7ab1962e
No related branches found
Branches containing commit
Tags
8.x-3.0-alpha32
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/gdpr_tasks/src/Form/CreateGdprRequestOnBehalfOfUserForm.php
+30
-3
30 additions, 3 deletions
...pr_tasks/src/Form/CreateGdprRequestOnBehalfOfUserForm.php
with
30 additions
and
3 deletions
modules/gdpr_tasks/src/Form/CreateGdprRequestOnBehalfOfUserForm.php
+
30
−
3
View file @
e8dce594
...
...
@@ -5,12 +5,40 @@ namespace Drupal\gdpr_tasks\Form;
use
Drupal\Core\Form\FormBase
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\gdpr_tasks
\Entity\Task
;
use
Drupal\Core\Queue\QueueFactory
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* Form for user task requests.
*/
class
CreateGdprRequestOnBehalfOfUserForm
extends
FormBase
{
/**
* The gdpr_tasks_process_gdpr_sar queue.
*
* @var \Drupal\Core\Queue\QueueInterface
*/
protected
$queue
;
/**
* {@inheritdoc}
*/
public
static
function
create
(
ContainerInterface
$container
)
{
return
new
static
(
$container
->
get
(
'queue'
)
);
}
/**
* Constructs a new CreateGdprRequestOnBehalfOfUserForm.
*
* @param \Drupal\Core\Queue\QueueFactory $queue
* Queue factory.
*/
public
function
__construct
(
QueueFactory
$queue
)
{
$this
->
queue
=
$queue
->
get
(
'gdpr_tasks_process_gdpr_sar'
);
}
/**
* {@inheritdoc}
*/
...
...
@@ -55,9 +83,8 @@ class CreateGdprRequestOnBehalfOfUserForm extends FormBase {
$task
->
save
();
if
(
$request_type
===
'gdpr_sar'
)
{
$queue
=
\Drupal
::
queue
(
'gdpr_tasks_process_gdpr_sar'
);
$queue
->
createQueue
();
$queue
->
createItem
(
$task
->
id
());
$this
->
queue
->
createQueue
();
$this
->
queue
->
createItem
(
$task
->
id
());
}
$this
->
messenger
()
->
addStatus
(
'The request has been logged'
);
...
...
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