stable

Clone or download

Read-only

fix: Force timezone in tracker notifications

Given the server is in the UTC timezone And two users are in New York timezone When one user adds a follow-up comment to an artifact Then the notification email body contains invalid information: the date of modification is formatted according UTC timezone whereas the written timezone next to it is New York You can test this by teleporting your dev environment in another timezone. To be sure I changed TZ everywhere (and chose a far away TZ): * `timedatectl set-timezone Asia/Tokyo` * date.timezone = Asia/Tokyo (in php.ini) * php_value[date.timezone] = Asia/Tokyo (in php-fpm.d/tuleap{-long-running-request,}.conf) Bonus: Took the opportunity to change the User::getTimezone return type to better reflect the reality, according to src/common/User/User.class.php:241 Closes request #23402: Timestamps in the body of emails are wrong Change-Id: I5eefa65ff3892d60ca03d2369060f7b48f3c91cc

Modified Files

Name
M plugins/tracker/include/Tracker/Artifact/Changeset/PostCreation/EmailNotificationTask.php +24 −16 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Artifact/Changeset/PostCreation/EmailNotificationTaskTest.php +4 −0 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Artifact/Changeset/PostCreation/NotifierCustomSenderTest.php +1 −0 Go to diff View file
A src/common/Date/TimezoneSwitcher.php +45 −0 Go to diff View file
M src/common/User/User.class.php +3 −4 Go to diff View file
M src/common/account/TimezoneSelectorPresenter.class.php +1 −1 Go to diff View file
A tests/unit/common/Date/TimezoneSwitcherTest.php +79 −0 Go to diff View file