"Fossies" - the Fresh Open Source Software Archive 
Member "RT-Extension-Assets-1.05/patches/rt-4.2.1-4.2.2.patch" (15 Oct 2014, 2198 Bytes) of package /linux/misc/RT-Extension-Assets-1.05.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 From 07dab422cf5081ce970cf3cfcbfd461926d02349 Mon Sep 17 00:00:00 2001
2 From: Alex Vandiver <alexmv@bestpractical.com>
3 Date: Tue, 28 Jan 2014 18:35:52 -0500
4 Subject: [PATCH 1/2] $user->PrincipalObj is _undef_ if the LoadByEmail failed
5
6 This prevents runtime errors when assigning unknown users as
7 single-member roles
8 ---
9 lib/RT/Record/Role/Roles.pm | 4 ++--
10 1 file changed, 2 insertions(+), 2 deletions(-)
11
12 diff --git a/lib/RT/Record/Role/Roles.pm b/lib/RT/Record/Role/Roles.pm
13 index aad2673..5c78f51 100644
14 --- a/lib/RT/Record/Role/Roles.pm
15 +++ b/lib/RT/Record/Role/Roles.pm
16 @@ -524,9 +524,9 @@ sub _ResolveRoles {
17 $user->LoadByEmail( $value ) unless $user->id;
18 $roles->{$role} = $user->PrincipalObj;
19 }
20 - unless ($roles->{$role}->id) {
21 + unless ($roles->{$role} and $roles->{$role}->id) {
22 push @errors, $self->loc("Invalid value for [_1]",loc($role));
23 - $roles->{$role} = RT->Nobody->PrincipalObj unless $roles->{$role}->id;
24 + $roles->{$role} = RT->Nobody->PrincipalObj;
25 }
26 # For consistency, we always return an arrayref
27 $roles->{$role} = [ $roles->{$role} ];
28 --
29 1.8.5.2
30
31 From a4070069ae2d21302e0dd1ec9c54e29c7ebdc97f Mon Sep 17 00:00:00 2001
32 From: Alex Vandiver <alexmv@bestpractical.com>
33 Date: Tue, 28 Jan 2014 18:36:19 -0500
34 Subject: [PATCH 2/2] loc() is only in scope by way of $self->
35
36 ---
37 lib/RT/Record/Role/Roles.pm | 2 +-
38 1 file changed, 1 insertion(+), 1 deletion(-)
39
40 diff --git a/lib/RT/Record/Role/Roles.pm b/lib/RT/Record/Role/Roles.pm
41 index 5c78f51..a6172b4 100644
42 --- a/lib/RT/Record/Role/Roles.pm
43 +++ b/lib/RT/Record/Role/Roles.pm
44 @@ -525,7 +525,7 @@ sub _ResolveRoles {
45 $roles->{$role} = $user->PrincipalObj;
46 }
47 unless ($roles->{$role} and $roles->{$role}->id) {
48 - push @errors, $self->loc("Invalid value for [_1]",loc($role));
49 + push @errors, $self->loc("Invalid value for [_1]",$self->loc($role));
50 $roles->{$role} = RT->Nobody->PrincipalObj;
51 }
52 # For consistency, we always return an arrayref
53 --
54 1.8.5.2
55