[Bps-public-commit] rt-extension-assets branch, 1.0-trunk, updated. a042b31b1e7823af4d8b950583753a182c9d2553

Alex Vandiver alexmv at bestpractical.com
Mon Feb 3 20:03:22 EST 2014


The branch, 1.0-trunk has been updated
       via  a042b31b1e7823af4d8b950583753a182c9d2553 (commit)
       via  627acafdc4b380c2d05e80eef5834c2002eb2f7f (commit)
      from  04c0cfaf130decd06988aff0b2dd9b4f82caf2e9 (commit)

Summary of changes:
 META.yml                     |  2 +-
 README                       | 30 +++++++++++++++---------
 lib/RT/Extension/Assets.pm   | 13 ++++++++++-
 patches/rt-4.2.1-4.2.2.patch | 55 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 87 insertions(+), 13 deletions(-)
 create mode 100644 patches/rt-4.2.1-4.2.2.patch

- Log -----------------------------------------------------------------
commit 627acafdc4b380c2d05e80eef5834c2002eb2f7f
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Feb 3 20:02:30 2014 -0500

    Provide patch from 4.2/single-role-group-resolve

diff --git a/lib/RT/Extension/Assets.pm b/lib/RT/Extension/Assets.pm
index e3a389c..b121d55 100644
--- a/lib/RT/Extension/Assets.pm
+++ b/lib/RT/Extension/Assets.pm
@@ -372,6 +372,8 @@ RT->AddJavaScript("RTx-Assets.js");
 
 =head1 INSTALLATION
 
+Assets requires version 4.2.1 or higher of RT.
+
 =over
 
 =item perl Makefile.PL
@@ -380,7 +382,16 @@ RT->AddJavaScript("RTx-Assets.js");
 
 =item make install
 
-May need root permissions
+This step may require root permissions.
+
+=item Patch your RT
+
+Assets requires a small patch to work on versions of RT prior to 4.2.3.
+To patch RT, run:
+
+    patch -d /opt/rt4 -p1 < patches/rt-4.2.1-4.2.2.patch
+
+RT version 4.2.3 and above already contain this patch.
 
 =item Edit your /opt/rt4/etc/RT_SiteConfig.pm
 
diff --git a/patches/rt-4.2.1-4.2.2.patch b/patches/rt-4.2.1-4.2.2.patch
new file mode 100644
index 0000000..aca898b
--- /dev/null
+++ b/patches/rt-4.2.1-4.2.2.patch
@@ -0,0 +1,55 @@
+From 07dab422cf5081ce970cf3cfcbfd461926d02349 Mon Sep 17 00:00:00 2001
+From: Alex Vandiver <alexmv at bestpractical.com>
+Date: Tue, 28 Jan 2014 18:35:52 -0500
+Subject: [PATCH 1/2] $user->PrincipalObj is _undef_ if the LoadByEmail failed
+
+This prevents runtime errors when assigning unknown users as
+single-member roles
+---
+ lib/RT/Record/Role/Roles.pm | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/RT/Record/Role/Roles.pm b/lib/RT/Record/Role/Roles.pm
+index aad2673..5c78f51 100644
+--- a/lib/RT/Record/Role/Roles.pm
++++ b/lib/RT/Record/Role/Roles.pm
+@@ -524,9 +524,9 @@ sub _ResolveRoles {
+                 $user->LoadByEmail( $value ) unless $user->id;
+                 $roles->{$role} = $user->PrincipalObj;
+             }
+-            unless ($roles->{$role}->id) {
++            unless ($roles->{$role} and $roles->{$role}->id) {
+                 push @errors, $self->loc("Invalid value for [_1]",loc($role));
+-                $roles->{$role} = RT->Nobody->PrincipalObj unless $roles->{$role}->id;
++                $roles->{$role} = RT->Nobody->PrincipalObj;
+             }
+             # For consistency, we always return an arrayref
+             $roles->{$role} = [ $roles->{$role} ];
+-- 
+1.8.5.2
+
+From a4070069ae2d21302e0dd1ec9c54e29c7ebdc97f Mon Sep 17 00:00:00 2001
+From: Alex Vandiver <alexmv at bestpractical.com>
+Date: Tue, 28 Jan 2014 18:36:19 -0500
+Subject: [PATCH 2/2] loc() is only in scope by way of $self->
+
+---
+ lib/RT/Record/Role/Roles.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/RT/Record/Role/Roles.pm b/lib/RT/Record/Role/Roles.pm
+index 5c78f51..a6172b4 100644
+--- a/lib/RT/Record/Role/Roles.pm
++++ b/lib/RT/Record/Role/Roles.pm
+@@ -525,7 +525,7 @@ sub _ResolveRoles {
+                 $roles->{$role} = $user->PrincipalObj;
+             }
+             unless ($roles->{$role} and $roles->{$role}->id) {
+-                push @errors, $self->loc("Invalid value for [_1]",loc($role));
++                push @errors, $self->loc("Invalid value for [_1]",$self->loc($role));
+                 $roles->{$role} = RT->Nobody->PrincipalObj;
+             }
+             # For consistency, we always return an arrayref
+-- 
+1.8.5.2
+

commit a042b31b1e7823af4d8b950583753a182c9d2553
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Feb 3 20:02:57 2014 -0500

    Update generated files

diff --git a/META.yml b/META.yml
index 54baa9e..101c47b 100644
--- a/META.yml
+++ b/META.yml
@@ -1,7 +1,7 @@
 ---
 abstract: 'RT Extension-Assets Extension'
 author:
-  - 'Thomas Sibley <trs at bestpractical.com>'
+  - 'Best Practical Solutions'
 build_requires:
   ExtUtils::MakeMaker: 6.59
   Test::Warn: 0
diff --git a/README b/README
index f26dde9..f07e941 100644
--- a/README
+++ b/README
@@ -2,10 +2,20 @@ NAME
     RT-Extension-Assets - Asset management for RT
 
 INSTALLATION
+    Assets requires version 4.2.1 or higher of RT.
+
     perl Makefile.PL
     make
     make install
-        May need root permissions
+        This step may require root permissions.
+
+    Patch your RT
+        Assets requires a small patch to work on versions of RT prior to
+        4.2.3. To patch RT, run:
+
+            patch -d /opt/rt4 -p1 < patches/rt-4.2.1-4.2.2.patch
+
+        RT version 4.2.3 and above already contain this patch.
 
     Edit your /opt/rt4/etc/RT_SiteConfig.pm
         Add this line:
@@ -39,7 +49,7 @@ INSTALLATION
 CONFIGURATION
   $DefaultCatalog
     Use this to define the default catalog name that will be used when first
-    searching for assets; thereafter, it will defaultto the last-searched
+    searching for assets; thereafter, it will default to the last-searched
     catalog. You may use either the catalog's name or its ID. This only
     affects the catalog selection on the asset search interface.
 
@@ -63,7 +73,7 @@ USAGE
     other qualities for categorizing, sorting, and searching.
 
   Managing catalogs
-    Catalogs are managed by RT adminstrators, or anyone with the
+    Catalogs are managed by RT administrators, or anyone with the
     "AdminCatalog" right. You can find the list of catalogs, create new
     catalogs, and manage existing ones under the Tools → Configuration →
     Assets → Catalogs menu.
@@ -233,7 +243,8 @@ USAGE
     Another extension, RT::Extension::Assets::Import::CSV provides tools to
     import new and update existing assets from a CSV dump. Its configuration
     lets you map the fields in the CSV to the asset fields you've already
-    created in RT.
+    created in RT. RT::Extension::Assets::AppleGSX also provides tools for
+    looking up data associated with an Apple product.
 
 METHODS ADDED TO OTHER CLASSES
   RT::CustomField
@@ -270,16 +281,13 @@ METHODS ADDED TO OTHER CLASSES
 
     Note that this will cause the collection to only return asset CFs.
 
-AUTHOR
-    Thomas Sibley <trs at bestpractical.com>
-
 BUGS
-    All bugs should be reported via
-    <http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-Assets>
-    or bug-RT-Extension-Assets at rt.cpan.org.
+    Please report bugs to assets-bugs at bestpractical.com; if you're not sure
+    if what you've discovered is a bug, please discuss it on
+    rt-users at lists.bestpractical.com before reporting it.
 
 LICENSE AND COPYRIGHT
-    This software is Copyright (c) 2013 by Best Practical Solutions
+    This software is Copyright (c) 2014 by Best Practical Solutions
 
     This is free software, licensed under:
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list