[Rt-commit] rt branch, 4.4/businesshours-7-warning, repushed
Shawn Moore
shawn at bestpractical.com
Wed Jan 18 12:09:33 EST 2017
The branch 4.4/businesshours-7-warning was deleted and repushed:
was 178443629a9c07d4406846f7f019358b8ceeef51
now c00e56a8dba7fc54f0db6986a1e74368cb7ac19b
1: 6ac8cd9 ! 1: 0c8b782 Switch SLA config get/set to use core RT patterns
@@ -1,6 +1,12 @@
Author: Shawn M Moore <shawn at bestpractical.com>
Switch SLA config get/set to use core RT patterns
+
+ This was a vestigate of SLA first being an extension, then being pulled
+ into core.
+
+ This enables the following commit to implement a PostLoadCheck for
+ ServiceBusinessHours.
diff --git a/lib/RT/Action/SLA_SetDue.pm b/lib/RT/Action/SLA_SetDue.pm
--- a/lib/RT/Action/SLA_SetDue.pm
2: 1784436 ! 2: c00e56a Log an error if config incorrectly specifies Sunday as 7
@@ -2,7 +2,12 @@
Log an error if config incorrectly specifies Sunday as 7
- Sunday should be specified as day 0.
+ Sunday should be specified as day 0. Specifying it as 7 is completely
+ and silently ignored.
+
+ This is an easy misconfiguration to make, especially because in some
+ cultures Sunday is shown on calendars as the last day of the week,
+ rather than the first as is customary in USA.
Fixes: I#32487
@@ -18,7 +23,7 @@
+ my $config = $self->Get('ServiceBusinessHours');
+ for my $name (keys %$config) {
+ if ($config->{$name}->{7}) {
-+ RT->Logger->error("Config option \%ServiceBusinessHours '$name' erroneously specifies Sunday as day 7; it should be specified as day 0.");
++ RT->Logger->error("Config option \%ServiceBusinessHours '$name' erroneously specifies '$config->{$name}->{7}->{Name}' as day 7; Sunday should be specified as day 0.");
+ }
+ }
+ },
@@ -43,7 +48,7 @@
+ RT->Config->Set(ServiceBusinessHours => (
+ Invalid => {
+ 7 => {
-+ Name => 'Sunday',
++ Name => 'Domingo',
+ Start => '9:00',
+ End => '17:00'
+ }
@@ -53,7 +58,7 @@
+ RT->Config->PostLoadCheck;
+
+ is(@warnings, 1);
-+ like($warnings[0], qr/Config option %ServiceBusinessHours 'Invalid' erroneously specifies Sunday as day 7; it should be specified as day 0\./);
++ like($warnings[0], qr/Config option %ServiceBusinessHours 'Invalid' erroneously specifies 'Domingo' as day 7; Sunday should be specified as day 0\./);
+}
+
done_testing();
More information about the rt-commit
mailing list