make import() compatible with Exporter
authorMike Rylander <mrylander@gmail.com>
Tue, 29 Jul 2014 16:45:09 +0000 (12:45 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 29 Jul 2014 16:45:09 +0000 (12:45 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm

index bab4afd..9954610 100644 (file)
@@ -59,11 +59,17 @@ sub personality {
 
 sub import {
     my $class = shift;
-    my %args = @_;
 
-    $class->personality( $args{personality} ) if ($args{personality});
+    my @super_args = ();
+    while ( my $a = shift ) {
+        if ($a eq 'personality') {
+            $class->personality( shift );
+        } else {
+            push @super_args, $a;
+        }
+    }
 
-    return 1;
+    return $class->SUPER::import( @super_args );
 }
 
 sub new_editor { return OpenILS::Utils::CStoreEditor->new(@_); }