[Rt-commit] rt branch, 4.2/initialdata-group-domain, created. rt-4.1.6-406-g67564e2

Alex Vandiver alexmv at bestpractical.com
Tue Apr 2 00:59:04 EDT 2013


The branch, 4.2/initialdata-group-domain has been created
        at  67564e2602648c9b24fb8be6c82e1551f1a791b3 (commit)

- Log -----------------------------------------------------------------
commit 67564e2602648c9b24fb8be6c82e1551f1a791b3
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Nov 2 16:32:50 2012 -0400

    Default Domain to UserDefined, which is the only sane value

diff --git a/docs/initialdata.pod b/docs/initialdata.pod
index 6445fb0..3f271e9 100644
--- a/docs/initialdata.pod
+++ b/docs/initialdata.pod
@@ -78,14 +78,13 @@ For a full list of fields, read the documentation for L<RT::User/Create>.
 =head2 C<@Groups>
 
     push @Groups, {
-        Domain      => 'UserDefined',
         Name        => 'Example Employees',
         Description => 'All of the employees of my company',
     };
 
 Creates a new L<RT::Group> for each hashref.  In almost all cases you'll want
 to follow the example above to create a group just as if you had done it from
-the admin interface.  B<Do not> omit the C<< Domain => 'UserDefined' >> line.
+the admin interface.
 
 Additionally, the C<MemberOf> field is specially handled to make it easier to
 add the new group to other groups.  C<MemberOf> may be a single value or an
diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index c782255..ad33dd0 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -773,6 +773,7 @@ sub InsertData {
         $RT::Logger->debug("Creating groups...");
         foreach my $item (@Groups) {
             my $new_entry = RT::Group->new( RT->SystemUser );
+            $item->{'Domain'} ||= 'UserDefined';
             my $member_of = delete $item->{'MemberOf'};
             my ( $return, $msg ) = $new_entry->_Create(%$item);
             unless ( $return ) {

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


More information about the Rt-commit mailing list