Workaround for bug where tradition gets undef user
Tara L Andrews [Fri, 16 Aug 2013 07:29:03 +0000 (09:29 +0200)]
lib/stemmaweb/Controller/Root.pm

index be1ba72..f66dcd5 100644 (file)
@@ -279,6 +279,9 @@ sub textinfo :Local :Args(1) {
                if( exists $params->{'owner'} ) {
                        # Only admins can update user / owner
                        my $newownerid = delete $params->{'owner'};
+                       if( $tradition->has_user && !$tradition->user ) {
+                               $tradition->clear_user;
+                       }
                        unless( !$newownerid || 
                                ( $tradition->has_user && $tradition->user->email eq $newownerid ) ) {
                                unless( $c->user->get_object->is_admin ) {