key duplication result on new reading rather than old
Tara L Andrews [Mon, 24 Jun 2013 21:17:16 +0000 (23:17 +0200)]
lib/stemmaweb/Controller/Relation.pm

index 52bc5f9..7dd0c73 100644 (file)
@@ -481,7 +481,9 @@ sub duplicate :Chained('text') :PathPart :Args(0) {
                                $errmsg = 'Something went wrong with the request';      
                        }
                        if( $newrdg ) {
-                               $response->{$reading_id} = _reading_struct( $newrdg );
+                               my $data = _reading_struct( $newrdg );
+                               $data->{'orig_rdg'} = $reading_id;
+                               $response->{"$newrdg"} = $data;
                        }
                } 
                if( $errmsg ) {