projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
defba8f
)
DomainTokens - {domain.now} should abide by mocked times
author
Tim Otten
<totten@civicrm.org>
Tue, 21 Sep 2021 08:47:08 +0000
(
01:47
-0700)
committer
Eileen McNaughton
<emcnaughton@wikimedia.org>
Wed, 22 Sep 2021 00:32:35 +0000
(12:32 +1200)
CRM/Core/DomainTokens.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Core/DomainTokens.php
b/CRM/Core/DomainTokens.php
index a79368e301befe38e2a92ba6228508320d01270f..fe7384270bef950898ba84e09d58867a5b837cc9 100644
(file)
--- a/
CRM/Core/DomainTokens.php
+++ b/
CRM/Core/DomainTokens.php
@@
-57,7
+57,8
@@
class CRM_Core_DomainTokens extends AbstractTokenSubscriber {
*/
public function evaluateToken(TokenRow $row, $entity, $field, $prefetch = NULL): void {
if ($field === 'now') {
- $row->format('text/html')->tokens($entity, $field, new DateTime());
+ $nowObj = (new \DateTime())->setTimestamp(\CRM_Utils_Time::time());
+ $row->format('text/html')->tokens($entity, $field, $nowObj);
return;
}
$row->format('text/html')->tokens($entity, $field, self::getDomainTokenValues()[$field]);