Skip to content

Commit 893cb63

Browse files
committed
Updated patches
1 parent 64fc6b2 commit 893cb63

File tree

2 files changed

+32
-26
lines changed

2 files changed

+32
-26
lines changed

patches/drupal/maestro/edit-task-id-in-query.patch

+1-26
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,4 @@ index 8893251..2107961 100644
1414
$template = MaestroEngine::getTemplate($templateMachineName);
1515
$task = MaestroEngine::getTemplateTaskByID($templateMachineName, $taskID);
1616
$task['form_state'] = $form_state;
17-
diff --git a/src/Engine/MaestroEngine.php b/src/Engine/MaestroEngine.php
18-
index 288736a..2781c37 100644
19-
--- a/src/Engine/MaestroEngine.php
20-
+++ b/src/Engine/MaestroEngine.php
21-
@@ -3,6 +3,7 @@
22-
namespace Drupal\maestro\Engine;
23-
24-
// Used in the dynamic task call for task execution.
25-
+use Drupal\Core\Session\AccountInterface;
26-
use Drupal\maestro\Engine\Exception\MaestroGeneralException;
27-
use Drupal\maestro\Engine\Exception\MaestroSaveEntityException;
28-
use Drupal\Core\Entity\EntityStorageException;
29-
@@ -638,6 +639,13 @@ class MaestroEngine {
30-
$account = User::load($userID);
31-
$userRoles = $account->getRoles(TRUE);
32-
33-
+ // An authenticated user does not actually have the role "authenticated",
34-
+ // but we may be assigning tasks to authenticated users. Therefore we add
35-
+ // the authenticated role to the list of roles to check for assignment.
36-
+ if ($account->isAuthenticated()) {
37-
+ $userRoles[] = AccountInterface::AUTHENTICATED_ROLE;
38-
+ }
39-
+
40-
$query = \Drupal::entityQuery('maestro_production_assignments')
41-
->accessCheck(FALSE);
42-
17+
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
diff --git a/src/Engine/MaestroEngine.php b/src/Engine/MaestroEngine.php
2+
index 2781c37..8037c52 100644
3+
--- a/src/Engine/MaestroEngine.php
4+
+++ b/src/Engine/MaestroEngine.php
5+
@@ -1538,7 +1538,7 @@ class MaestroEngine {
6+
$taskMachineName = $queueRecord->task_id->getString();
7+
$templateMachineName = MaestroEngine::getTemplateIdFromProcessId($queueRecord->process_id->getString());
8+
// Just days * seconds to get an offset.
9+
- $reminderInterval = intval($queueRecord->reminder_interval->getString()) * 86400;
10+
+ $reminderInterval = intval($queueRecord->reminder_interval->getString()) * 60;
11+
// we're in here because we need a reminder. So do it.
12+
$this->doProductionAssignmentNotifications($templateMachineName, $taskMachineName, $queueID, 'reminder');
13+
$queueRecord->set('next_reminder_time', $currentTime + $reminderInterval);
14+
@@ -1568,7 +1568,7 @@ class MaestroEngine {
15+
$numberOfEscalationsSent = intval($queueRecord->num_escalations_sent->getString());
16+
// First time through, numberOfEscalations is 0... second time it's 1 etc.
17+
// that means that our interval needs to be numberOfEscalations +1 * the offset of the escalation in days.
18+
- $escalationInterval = (1 + $numberOfEscalationsSent) * (intval($queueRecord->escalation_interval->getString()) * 86400);
19+
+ $escalationInterval = (1 + $numberOfEscalationsSent) * (intval($queueRecord->escalation_interval->getString()) * 60);
20+
if ($currentTime > ($createdTime + $escalationInterval)) {
21+
// We need to send out an escalation.
22+
$this->doProductionAssignmentNotifications($templateMachineName, $taskMachineName, $queueID, 'escalation');
23+
@@ -1837,7 +1837,7 @@ class MaestroEngine {
24+
if (array_key_exists('notifications', $nextTask)) {
25+
$reminderInterval = $nextTask['notifications']['reminder_after'];
26+
if (intval($reminderInterval) > 0) {
27+
- $nextReminderTime = $currentTime + (intval($reminderInterval) * 86400);
28+
+ $nextReminderTime = $currentTime + (intval($reminderInterval) * 60);
29+
}
30+
$escalationInterval = $nextTask['notifications']['escalation_after'];
31+
}

0 commit comments

Comments
 (0)