[Rt-commit] rt branch, 5.0/subject-tag-unicode-fix, repushed
Craig Kaiser
craig at bestpractical.com
Wed Jun 16 09:46:16 EDT 2021
The branch 5.0/subject-tag-unicode-fix was deleted and repushed:
was c399b9d4ebfd866ea2b969e29a0db178634c4875
now 870cdb8f7353dac20a5634e1ac780ef794c96582
1: e8452ef0da ! 1: f153415db6 Add test for subject tag with unicode characters
@@ -34,9 +34,9 @@
+ my ($status, $msg) = $queue->SetSubjectTag( $subject_tag );
+ ok $status, "set subject tag for the queue" or diag "error: $msg";
+
-+ my @subject_tags = RT->System->SubjectTag();
++ my @subject_tags = sort RT->System->SubjectTag();
+
-+ is($subject_tags[1], $subject_tag, "Set Subject Tag to $subject_tag");
++ is($subject_tags[0], $subject_tag, "Set Subject Tag to $subject_tag");
+}
+
+done_testing();
2: c399b9d4eb ! 2: 870cdb8f73 Ensure values returned from DistinctFieldValues are utf8
@@ -11,16 +11,16 @@
+sub DistinctFieldValues {
+ my $self = shift;
-+ my $field = shift;
-+ my %args = ( decode_utf8 => 1, @_ );
++ my %args = (
++ Field => undef,
++ Order => undef,
++ Max => undef,
++ decode_utf8 => 1,
++ @_%2 ? (Field => @_) : (@_)
++ );
+
-+ unless ($field) {
-+ $RT::Logger->error("DistinctFieldValues called with undef field");
-+ }
++ my @values = $self->SUPER::DistinctFieldValues( %args );
+
-+ my @values = $self->SUPER::DistinctFieldValues($field);
-+
-+ my @unicodeValues = ();
+ foreach my $value ( @values ) {
+ if ( $args{'decode_utf8'} ) {
+ if ( !utf8::is_utf8( $value ) ) { # mysql/sqlite
@@ -32,9 +32,8 @@
+ utf8::encode( $value );
+ }
+ }
-+ push @unicodeValues, $value;
+ }
-+ return @unicodeValues;
++ return @values;
+}
+
RT::Base->_ImportOverlays();
More information about the rt-commit
mailing list