George S. Baugh 4 سال پیش
والد
کامیت
4736514b34
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      lib/Trog/DataModule.pm

+ 3 - 1
lib/Trog/DataModule.pm

@@ -241,10 +241,12 @@ sub add ($self, @posts) {
     my @to_write;
     foreach my $post (@posts) {
         $post->{id} //= UUID::Tiny::create_uuid_as_string(UUID::Tiny::UUID_V1, UUID::Tiny::UUID_NS_DNS);
+        $post->{aliases} //= [];
+        $post->{aliases} = [$post->{aliases}] unless ref $post->{aliases} eq 'ARRAY';
         if ($post->{aclname}) {
             # Then this is a series
             $post->{local_href} //= "/$post->{aclname}";
-            $post->{aliases} = ["/posts/$post->{id}","/series/$post->{id}"];
+            push(@{$post->{aliases}}, "/posts/$post->{id}", "/series/$post->{id}" );
         }
 
         $post->{local_href} //= "/posts/$post->{id}";