Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit fbd1689

Browse files
authored
Merge branch 'develop' into feature/DW-568-inherit-session
2 parents 380c530 + a6e4174 commit fbd1689

File tree

6 files changed

+47
-8
lines changed

6 files changed

+47
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Ignore IntelliJ
22
.idea/*
3+
34
composer.lock
45
vendor

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ before starting to add changes.
99

1010
## [Unreleased]
1111

12+
## 2.5.0 - 11.10.2022
13+
14+
### Added
15+
- retry task controller action
16+
- Added support for inheriting values without creating a submission
17+
18+
## 2.4.0
19+
1220
### Added
1321
- Github CI action for checking Drupal Coding standards with PHP Code Sniffer
1422
- Fixed coding standards issues

composer.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@
7979
},
8080
"drupal/coc_forms_auto_export": {
8181
"3240592 - Problem with phpseclib requirement in 2.x (https://www.drupal.org/project/coc_forms_auto_export/issues/3240592)": "https://www.drupal.org/files/issues/2021-10-04/requirement-namespace-3240592-1.patch"
82-
},
83-
"drupal/smtp": {
84-
"Duplicated attachments in emails generated by Webform: (https://www.drupal.org/project/smtp/issues/2995290)": "https://www.drupal.org/files/issues/2021-11-02/smtp-2995290-23.patch"
8582
}
8683
}
8784
},
@@ -102,10 +99,10 @@
10299
"config": {
103100
"sort-packages": true,
104101
"allow-plugins": {
105-
"cweagans/composer-patches": true,
106-
"zaporylie/composer-drupal-optimizations": true,
102+
"simplesamlphp/composer-module-installer": true,
107103
"dealerdirect/phpcodesniffer-composer-installer": true,
108-
"simplesamlphp/composer-module-installer": true
104+
"cweagans/composer-patches": true,
105+
"zaporylie/composer-drupal-optimizations": true
109106
}
110107
}
111108
}

os2forms_forloeb.module

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function os2forms_forloeb_workflow_maestro_reassign_form_submit(&$form, &$form_s
9898
*/
9999
function os2forms_forloeb_maestro_batch_handlers() {
100100
return [
101-
'end_notification_batch_function' => t('Batch function to send out flow completion notification to initiator.'),
101+
'_os2forms_forloeb_end_notification_batch_function' => t('Batch function to send out flow completion notification to initiator.'),
102102
];
103103
}
104104

@@ -110,7 +110,7 @@ function os2forms_forloeb_maestro_batch_handlers() {
110110
* @param int $queueID
111111
* The Maestro queue ID.
112112
*/
113-
function end_notification_batch_function($processID, $queueID) {
113+
function _os2forms_forloeb_end_notification_batch_function($processID, $queueID) {
114114

115115
/*
116116
* Pseudocode for handling this:

os2forms_forloeb.routing.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,13 @@ os2forms_forloeb.forloeb_task_console_controller_execute:
77
_permission: 'access content'
88
options:
99
no_cache: TRUE
10+
11+
os2forms_forloeb.forloeb_task_console_controller_execute_retry:
12+
path: 'os2forms-forloeb/execute-task-retry'
13+
defaults:
14+
_controller: '\Drupal\os2forms_forloeb\Controller\ForloebTaskConsoleController::retry'
15+
_title: 'Task not yet ready'
16+
requirements:
17+
_permission: 'access content'
18+
options:
19+
no_cache: TRUE

src/Controller/ForloebTaskConsoleController.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Drupal\Component\Utility\UrlHelper;
66
use Drupal\Core\Controller\ControllerBase;
77
use Drupal\Core\Entity\EntityTypeManagerInterface;
8+
use Drupal\Core\StringTranslation\StringTranslationTrait;
89
use Drupal\Core\Url;
910
use Drupal\maestro\Engine\MaestroEngine;
1011
use Drupal\maestro\Utility\TaskHandler;
@@ -19,6 +20,8 @@
1920
*/
2021
class ForloebTaskConsoleController extends ControllerBase {
2122

23+
use StringTranslationTrait;
24+
2225
/**
2326
* Update manager service.
2427
*
@@ -82,6 +85,12 @@ public function execute() {
8285
$token = $this->requestStack->getCurrentRequest()->query->get('os2forms-forloeb-ws-token', '');
8386
if ($token) {
8487
$queueRecord = $this->forloebTaskConsole->getQueueIdByWebformSubmissionToken($token);
88+
if (empty($queueRecord)) {
89+
return new RedirectResponse(
90+
Url::fromRoute('os2forms_forloeb.forloeb_task_console_controller_execute_retry',
91+
['referrer' => \Drupal::request()->getRequestUri()])->toString()
92+
);
93+
}
8594
}
8695
else {
8796
// For empty token there is user last task from taskconsole queue.
@@ -150,4 +159,18 @@ public function execute() {
150159
return new RedirectResponse($redirect_to->toString());
151160
}
152161

162+
/**
163+
* Show message about task not yet ready.
164+
*
165+
* @return array
166+
* The render array.
167+
*/
168+
public function retry() {
169+
$referrer = $this->requestStack->getCurrentRequest()->query->get('referrer', '#');
170+
171+
return [
172+
'#markup' => $this->t('Your task is not yet ready. Please <a href=":referrer">try again</a> in 5 minutes.', [':referrer' => $referrer]),
173+
];
174+
}
175+
153176
}

0 commit comments

Comments
 (0)